Code:
#!/usr/binperl
use Time::Local;
$start_date=shift;
$end_date=shift;
chomp($start_date,$end_date);
@dt1=split(/-/,$start_date);
@dt2=split(/-/,$end_date);
%months=("JAN"=>"01",
"FEB"=>"02",
"MAR"=>"03",
"APR"=>"04",
"MAY"=>"05",
"JUN"=>"06",
"JUL"=>"07",
"AUG"=>"08",
"SEP"=>"09",
"OCT"=>"10",
"NOV"=>"11",
"DEC"=>"12");
$start=timelocal(0,0,0,int($dt1[0]),int($months{$dt1[1]})-1,int($dt1[2])-1900);
$finish=timelocal(0,0,0,int($dt2[0]),int($months{$dt2[1]})-1,int($dt2[2])-1900);
while ($start <= $finish) {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$julian,$isdst) = localtime($start);
printf "%4d%02d%02d|%02d\n", $year + 2000, $mon + 1, $mday, int($julian/7) + 1;
$start += 24*60*60;
}