Change 34786 by [EMAIL PROTECTED] on 2008/11/10 03:56:34

        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/perl/lib/File/Find.pm#96 edit

Differences ...

==== //depot/perl/lib/File/Find.pm#96 (text) ====
Index: perl/lib/File/Find.pm
--- perl/lib/File/Find.pm#95~33911~     2008-05-22 23:18:59.000000000 -0700
+++ perl/lib/File/Find.pm       2008-11-09 19:56:34.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