|
|
| P is for Practical | |
| PerlMonks |
Re: Recursive search and deleteby roboticus (Canon) |
| on Nov 16, 2012 at 11:16 UTC ( #1004173=note: print w/ replies, xml ) | Need Help?? |
|
You already have several good answers, so I'm not really adding much. However, I've not played much with opendir or readdir and I thought I'd like to play with them a bit. I didn't want a recursive solution, so I did it this way:
It's not particularly pretty, but it amused me for a few minutes. I didn't actually let it do file deletions because I'm loath to do automatic deletes until I've well tested such a script. It's a good thing, too. On my earlier attempt, a pair of bugs conspired to make the script "process" all "abc*.xml" files on my hard drive, rather than just those in the ABC directory. ...roboticus When your only tool is a hammer, all problems look like your thumb.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||