in reply to How do you make File::Find a bit less ugly?
That's why I tend to favor using the standard "find" utility from within the perl script, the best idiom being something like:
with other options added as needed on the "find" command line. Some might think this is "ugly" because it's not pure Perl, and some might think the "find" command is ugly in its own way, but if you've read the man page and know how to use it, it works, it's pretty simple, and nothing else is faster (and some others do seem to agree that "find"-based usage is not as ugly as File::Find).my $path = "/whatever/path"; { local $/ = "\0"; open( FIND, "find $path -print0 |" ); while (<FIND>) { chomp; # do something with this name... } }
Since there are Windows ports of this basic utility, the only barrier to using it would be boneheaded policy constraints against installing such apps on Windows machines. For *n*x users, it seems like a no-brainer.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do you make File::Find a bit less ugly?
by bart (Canon) on Jun 14, 2006 at 08:06 UTC | |
by parv (Parson) on Jun 15, 2006 at 01:49 UTC |