in reply to Getting the current week number

POSIX::strftime can simplify that - the %U, %V, %W formats give the week of the year by different reckonings. How about subtracting the week of the year for the first of the month from the current week of the year?

#!/usr/bin/perl use POSIX 'strftime'; my @now = localtime; my @first = @now; $first[3] = 0; print strftime('%V',@now) - strftime('%V',@first), $/ __END__ 3
There are lots of ways to count weeks, depending on when you start. The strftime formats label them from 00 to 53. %U counts the first sunday of the year as the start of week 01. %V follows ISO 8601:1988 and calls week 01 the first with at least four days. %W is like %U, but counts the first Monday as the start of week 01.

If you want the weeks to start at 1 on the first of the month, you can just figure it from the day of the month: print 1 + int((localtime)[3]/7),$/;

After Compline,
Zaxo