Before we start, I want to remind you that not every day is 24 hours long. The length of a day can be 22, 23, 24, 25 or 26 hours. This means that what you want to do will inherently add errors to your data.
I'd normally be the first to instruct you to use a module, because a good date/time module is designed to prevent you from doing exactly what you ask for. That means it's easier to solve your problem from scratch rather that using a module. In fact, it's not even possible to do what you want with the module I normally use, DateTime.
my ($hours1, $minutes1) = split /:/, $arg1;
my ($hours2, $minutes2) = split /:/, $arg2;
my $hours = $hours1 + $hours2;
my $minutes = $minutes1 + $minutes2;
$hours += ($minutes - ($minutes % 60)) / 60; $minutes %= 60;
my $days = ($hours - ($hours % 24)) / 24; $hours %= 24;
my $weeks = ($days - ($days % 7)) / 7; $days %= 7;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…