in reply to Does a file really exist?
use Time::Local; my $time = timelocal(0,0,0,$mday,$month,$year);
then your date comparisons become a simple numeric comparison
also there is no need to make a system call to ls to get the filenames, a file glob would do
@list = <*_weather.*>;
update: I was working too hard as well :) Your dates are in a sensible format (yyyy-mm-dd), remove the dashes and you can just compare them numerically, much easier :)
update2: thanks to tilly for pointing out I am still working too hard: yyyy-mm-dd can be compared with cmp no need to remove the dashes at all.
--
my $chainsaw = 'Perl';
|
|---|