in reply to file::find
Note that I used an anonymous subroutine here. The above could have been written as follows:use File::Find; find( sub { /\.tex$/ && print "$File::Find::name\n" }, 'Docs');
A good way to learn is to use the find2perl program, which should be included in your Perl distribution. It takes the same arguments as the find command, and spits out a Perl program that uses the File::Find module to do the same thing. By looking at the generated programs you can learn a lot about how to use the module.find(\&wanted, 'Docs'); sub wanted { /\.tex$/ && print "$File::Find::name\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: file::find
by btrott (Parson) on May 01, 2000 at 21:13 UTC |