jlongino has asked for the wisdom of the Perl Monks concerning the following question:
I created a generalized sub in order to make repeated searches with different arguments, as it doesn't make sense to create separate wanted subs for each search.
The parts I'm particularly suspicious about are:
Also, I would like to learn a little about the statement:
if someone could direct me what to look it up under. Thanks for your time.*name = *File::Find::name;
use strict; my @found_files = Search_File('c:/Documents and Settings','udefdown.lo +g'); foreach (@found_files) { print "found: '$_'\n"; } sub Search_File { use File::Find (); # for the convenience of &wanted calls, including -eval statements: use vars qw/*name/; *name = *File::Find::name; our ($start_path, $search_name) = @_; our @matching_files = (); if ($search_name) { # Traverse desired filesystems File::Find::find({wanted => \&wanted}, $start_path); } return @matching_files; sub wanted { /^$search_name\z/si && push(@matching_files, $name); } }
"640K ought to be enough for anybody." -- Bill Gates, 1981
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Fiddling with File::Find
by merlyn (Sage) on Oct 05, 2001 at 01:12 UTC | |
by jlongino (Parson) on Oct 06, 2001 at 02:18 UTC | |
by chromatic (Archbishop) on Nov 19, 2001 at 01:01 UTC | |
by jlongino (Parson) on Nov 19, 2001 at 01:46 UTC | |
by merlyn (Sage) on Oct 06, 2001 at 19:53 UTC | |
|
(jeffa) Re: Fiddling with File::Find
by jeffa (Bishop) on Oct 05, 2001 at 01:20 UTC |