From: Gurusamy Sarathy Date: Fri, 2 Oct 1998 02:33:39 +0000 (+0000) Subject: make File::Find work when wanted() is autoloaded or a symbolic ref X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=98793e5e0892e3c4c0eee3f383929fc111b4db05;p=p5sagit%2Fp5-mst-13.2.git make File::Find work when wanted() is autoloaded or a symbolic ref p4raw-id: //depot/perl@1908 --- diff --git a/lib/File/Find.pm b/lib/File/Find.pm index 1305d21..9cd5c06 100644 --- a/lib/File/Find.pm +++ b/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 should be a -code reference. This code reference is called I 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 should be a code reference. This code +reference is called I below. Currently the only other supported key for the above hash is C, in presense of which the walk over directories is @@ -194,7 +194,7 @@ sub finddir { sub wrap_wanted { my $wanted = shift; - defined &$wanted ? {wanted => $wanted} : $wanted; + ref($wanted) eq 'HASH' ? $wanted : { wanted => $wanted }; } sub find {