From 98793e5e0892e3c4c0eee3f383929fc111b4db05 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Fri, 2 Oct 1998 02:33:39 +0000 Subject: [PATCH] make File::Find work when wanted() is autoloaded or a symbolic ref p4raw-id: //depot/perl@1908 --- lib/File/Find.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 { -- 2.7.4