develooper Front page | perl.perl5.porters | Postings from August 2008

Re: [perl #57926] File::Find Bug

Thread Previous
From:
Eric Brine
Date:
August 21, 2008 22:08
Subject:
Re: [perl #57926] File::Find Bug
Message ID:
f86994700808212208p2f170a57r84ea71374a1b7c4b@mail.gmail.com
On Fri, Aug 15, 2008 at 9:34 AM, Steve Peters <steve@fisharerojo.org> wrote:

> Thank you for the report.  I have a good idea what's happening, but it
> would help us out in reproducing your bug if you could provide a small
> piece of code based on your code that is failing.
>

vvv CODE vvv
use strict;
use warnings;

use File::Find qw( find );

my %good_options = (
   no_chdir => 1,
   wanted   => sub { die "woot\n" },
);


my %bad_options = (
   no_chdir => 1,
);

$|=1;

print("Good:\n"); eval { find(\%good_options, '.'); }; print($@);
print("\n");
print("Bad:\n");  eval { find(\%bad_options,  '.'); }; print($@);
^^^ CODE ^^^

vvv OUTPUT vvv
Good:
woot

Bad:
Use of uninitialized value in subroutine entry at
C:/progs/perl588/lib/File/Find.pm line 822.
Can't use string ("") as a subroutine ref while "strict refs" in use at
C:/progs/perl588/lib/File/Find.pm line 822.
^^^ OUTPUT ^^^

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About