From: Renee Baecker Date: Fri, 22 Aug 2008 16:42:02 +0000 (+0200) Subject: [perl #57926][PATCH] File::Find Bug X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c90698d34887827b84c506151478ca1f0dcacbd;p=p5sagit%2Fp5-mst-13.2.git [perl #57926][PATCH] File::Find Bug Message-Id: <20080822144202.659AB99C002@rserv16.sitepush.net> p4raw-id: //depot/perl@34786 --- diff --git a/lib/File/Find.pm b/lib/File/Find.pm index d39063b..641e420 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -3,7 +3,7 @@ use 5.006; use strict; use warnings; use warnings::register; -our $VERSION = '1.13'; +our $VERSION = '1.14'; require Exporter; require Cwd; @@ -78,7 +78,8 @@ Here are the possible keys for the hash: =item C The value should be a code reference. This code reference is -described in L below. +described in L below. The C<&wanted> subroutine is +mandatory. =item C @@ -1266,6 +1267,9 @@ sub _find_dir_symlnk($$$) { sub wrap_wanted { my $wanted = shift; if ( ref($wanted) eq 'HASH' ) { + unless( exists $wanted->{wanted} and ref( $wanted->{wanted} ) eq 'CODE' ) { + die 'no &wanted subroutine given'; + } if ( $wanted->{follow} || $wanted->{follow_fast}) { $wanted->{follow_skip} = 1 unless defined $wanted->{follow_skip}; } @@ -1276,9 +1280,12 @@ sub wrap_wanted { } return $wanted; } - else { + elsif( ref( $wanted ) eq 'CODE' ) { return { wanted => $wanted }; } + else { + die 'no &wanted subroutine given'; + } } sub find {