#!perl # Parse time string ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); # Calculate number of full weeks this year $week = int(($yday+1-$wday)/7); # Add 1 if today isn't Saturday if ($wday < 6) {$week +=1;} print "Week $week\n";