Change 34788 by [EMAIL PROTECTED] on 2008/11/10 08:41:27

        Integrate:
        [ 34786]
        Subject: [perl #57926][PATCH] File::Find Bug
        From: [EMAIL PROTECTED]
        Date: Fri, 22 Aug 2008 16:42:02 +0200 (CEST)
        Message-Id: <[EMAIL PROTECTED]>

Affected files ...

... //depot/maint-5.10/perl/lib/File/Find.pm#6 integrate

Differences ...

==== //depot/maint-5.10/perl/lib/File/Find.pm#6 (text) ====
Index: perl/lib/File/Find.pm
--- perl/lib/File/Find.pm#5~33917~      2008-05-23 13:43:31.000000000 -0700
+++ perl/lib/File/Find.pm       2008-11-10 00:41:27.000000000 -0800
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use warnings::register;
-our $VERSION = '1.13';
+our $VERSION = '1.14';
 require Exporter;
 require Cwd;
 
@@ -78,7 +78,8 @@
 =item C<wanted>
 
 The value should be a code reference.  This code reference is
-described in L<The wanted function> below.
+described in L<The wanted function> below. The C<&wanted> subroutine is
+mandatory.
 
 =item C<bydepth>
 
@@ -1266,6 +1267,9 @@
 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 @@
        }
        return $wanted;
     }
-    else {
+    elsif( ref( $wanted ) eq 'CODE' ) {
        return { wanted => $wanted };
     }
+    else {
+       die 'no &wanted subroutine given';
+    }
 }
 
 sub find {
End of Patch.

Reply via email to