in reply to Deleting files older then 48 hours..
But then you seem to want to do this in perl. Simply put a check into your loop:
(Please note the regexp test (/blahblah/) could be replaced by string equality ( eq "blahblah.zip") when you really(!) need performance, and please lookup the return values of -M and stat since I'm not really sure of it).foreach $file (<*.zip>) { next if $file =~ /blahblah/; # continue with filetype- and time-checking and # deletion... unless (-d $file) { # no dirs # use stat($file)[9] which is mtime in seconds, I # think, or use the -M filetest which gives days # to find out whether to delete or not... } }
Maybe you should consider using File::Find for this...
| Regards... | Stefan |
| you begin bashing the string with a +42 regexp of confusion | |
|
|---|