Also
while (@dates) { ...... shift(@dates); } [download]
better to write as:
foreach my $date (@dates) { ..... } [download]
In reply to Re: Improve My Code... by Gangabass in thread Improve My Code... by cheech