use Date::Calc qw(:all); $count = 0; #insert your own year. $year = "2011"; #set $date to the first day of the year @date = ($year,1,1); print Date_to_Text(@date) . "\n"; #find the next thursday if(Day_of_Week(@date) > 4) { @date= Add_Delta_Days(@date,7-Day_of_Week(@date)+4); } else { @date=Add_Delta_Days(@date,4-Day_of_Week(@date)); } #now you have the first thursday. Now just count how many #until you reach a new year while(@date[0] eq $year) { $count++; @date=Add_Delta_Days(@date,7); } print "$count thursdays in $year\n";