|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: Efficient deletion of files / shell interactionby kyle (Abbot) |
| on Jul 19, 2009 at 17:55 UTC ( #781471=note: print w/ replies, xml ) | Need Help?? |
|
I might write this, if I didn't care if anyone can read it.
Note that I haven't tried this, and given that it calls unlink, one would do well to test it with a copy of real data before trying it with real data. This has the advantages that it shells out to run tail only once on the list of every log file and that it calls unlink only once with the list of the files to delete. On the other hand, the heavy use of map and grep means it does more looping than is absolutely necessary.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||