use Date::Calc qw( Today Day_of_Week ); my ($year,$month,$day) = Today(); my $week = int(($day + Day_of_Week($year,$month,1) - 2) / 7) + 1;