use strict; use File::Find; use Getopt::Std; use vars qw(%opts); getopts('d:n:',\%opts); my ($dir,$name) = @opts{qw(d n)}; USAGE() and exit unless $dir and $name; find sub { print "$_\n" if /$name/ }, $dir; sub USAGE { print "USAGE: $0 -d dir -n filename\n" }
i like merlyn's better though :)
(slight update - removed one silly line)
jeffa
In reply to (jeffa) Re: Fiddling with File::Find
by jeffa
in thread Fiddling with File::Find
by jlongino
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |