8.100. File::FindLooks for files that match a particular expression. Exports two functions.
find (\&wanted, dir1[, dir2 ...]) Works like the Unix find command; traverses the specified directories, looking for files that match the expressions or actions you specify in a subroutine called wanted, which you must define. For example, to print out the names of all executable files, you could define wanted this way: sub wanted { print "$File::Find::name\n" if -x; } Provides the following variables:
finddepth (\wanted, dir1[, dir2...]) Like find, but does a depth-first search. The standard Perl distribution comes with a Perl script, find2perl, which takes a Unix find command and turns it into a wanted subroutine. Copyright © 2002 O'Reilly & Associates. All rights reserved. |
|