in reply to Re: Deleting Oldest Logfiles
in thread Deleting Oldest Logfiles
Don't forget to chomp the incoming list. Also, if all you do is read the results immediately and use them directly, backticks are simpler.
chomp( my @Files = `ls -1t $LOGSTR` ); die "No files?" if ! @Files;
I agree with the idea of using ls to get a sorted list of files. It's a lot easier than a manual stat and sort (though there's probably a module to do it for you).
|
|---|