in reply to Fiddling with File::Find
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
|
|---|