in reply to Re: Delete files matching pattern
in thread Delete files matching pattern
The calling and callback mechanisms for File::Find, in contrast, are relatively Byzantine -- obscure and fraught with traps for the unwary and uninitiated. (Much more study and learning is needed to use File::Find at all, let alone use it effectively.) Not only that, but File::Find tends to consume more run-time than other approaches. It has it's uses, but I don't think this is one of them.
Speaking of reducing run-time, when adopting one of the glob or readdir approaches above, I'd put the regex match before the "-f" test, since doing a stat on every file will take a little extra time, compared to stat'ing just the ones that match the file name pattern.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Delete files matching pattern
by radiantmatrix (Parson) on May 10, 2005 at 16:07 UTC |