summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/lib/File/Find.pm
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>1999-05-02 14:33:17 +0000
committermarkm <markm@FreeBSD.org>1999-05-02 14:33:17 +0000
commit77644ee620b6a79cf8c538abaf7cd301a875528d (patch)
treeb4adabf341898a4378f4b7f8c7fb65f3f7c77769 /contrib/perl5/lib/File/Find.pm
parent4fcbc3669aa997848e15198cc9fb856287a6788c (diff)
downloadFreeBSD-src-77644ee620b6a79cf8c538abaf7cd301a875528d.zip
FreeBSD-src-77644ee620b6a79cf8c538abaf7cd301a875528d.tar.gz
Maintenance releace 3 of perl5.005. Includes support for threads.
Diffstat (limited to 'contrib/perl5/lib/File/Find.pm')
-rw-r--r--contrib/perl5/lib/File/Find.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/perl5/lib/File/Find.pm b/contrib/perl5/lib/File/Find.pm
index 1305d21..7e67003 100644
--- a/contrib/perl5/lib/File/Find.pm
+++ b/contrib/perl5/lib/File/Find.pm
@@ -22,10 +22,10 @@ finddepth - traverse a directory structure depth-first
=head1 DESCRIPTION
The first argument to find() is either a hash reference describing the
-operations to be performed for each file, or a code reference. If it
-is a hash reference, then the value for the key C<wanted> should be a
-code reference. This code reference is called I<the wanted()
-function> below.
+operations to be performed for each file, a code reference, or a string
+that contains a subroutine name. If it is a hash reference, then the
+value for the key C<wanted> should be a code reference. This code
+reference is called I<the wanted() function> below.
Currently the only other supported key for the above hash is
C<bydepth>, in presense of which the walk over directories is
@@ -177,6 +177,8 @@ sub finddir {
--$subcount;
next if $prune;
+ # Untaint $_, so that we can do a chdir
+ $_ = $1 if /^(.*)/;
if (chdir $_) {
$name =~ s/\.dir$// if $Is_VMS;
&finddir($wanted,$name,$nlink, $bydepth);
@@ -194,7 +196,7 @@ sub finddir {
sub wrap_wanted {
my $wanted = shift;
- defined &$wanted ? {wanted => $wanted} : $wanted;
+ ref($wanted) eq 'HASH' ? $wanted : { wanted => $wanted };
}
sub find {
OpenPOWER on IntegriCloud