Perl Script : Split given month into weeks

I want to split a given month into weeks. For example if I give the date in dd/mm/yy format say 01/02/08 it should give output in the given format :
week1 : start date and end date.
week2 : ""
week3 : ""
week4 : ""

#!/usr/bin/ksh
echo ${1:-`date "+%d/%m/%y"`} | awk -F'/' '{print $2" 20"$3}' | \
        cal | awk '(NR>2)&&/[0-9]/{printf("week %d : %2d and %2d\n",NR-2,$1,$NF)}'

Output:

$ mth2wk
week 1 :  1 and  2
week 2 :  3 and  9
week 3 : 10 and 16
week 4 : 17 and 23
week 5 : 24 and 29
$
$ mth2wk 01/02/08
week 1 :  1 and  2
week 2 :  3 and  9
week 3 : 10 and 16
week 4 : 17 and 23
week 5 : 24 and 29

HTH

link removed might get you started

That is a link to a pirated copy of the material. I doubt this forum allows the inconsiderate posting or such links.

Please don't post links to copyrighted material. Thanks.

There are a number of Date modules on CPAN, Date::Range, Date::Simple, and a number of others that probably already do what you are asking.