in reply to Expanding dates
Update:Test your code before you press that pesky Submit button ...
You want to do some globbing on the filenames. This could be done with the perlfunc:glob() builtin, but you also want some ordering.
Here is one approach :
my ($startdate, $enddate); $startdate .= "01" while( length( $startdate ) <= 8 ); $enddate .= "01" while( length( $enddate ) <= 8 );
my (@logfilelist); @logfilelist = sort @logfilelist; # Cut away everything that is too early while ($#logfilelist > -1 && $startdate lt @logfilelist[0]) { shift @logfilelist; }; # Cut away everything that is too late while ($#logfilelist > -1 && $enddate gt @logfilelist[-1]) { pop @logfilelist; }; # Now, @logfilelist contains all the logfiles in question
|
|---|