use File::Find; my $root_dir = '/files/misc/; sub find_zip { print "Found zip file $_\n" if /\.zip\z/; } find ( \&find_zip, $root_dir );
find() traverses the directory tree under $root_dir and passes the name of every file in $_ to the find_zip() 'call back' sub. Note we use a sub reference as shown in find. The reference is indicated by the \ before the &
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: File::Find question
by tachyon
in thread File::Find question
by shluff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |