develooper Front page | perl.perl5.porters | Postings from December 2004

RE: [perl #32993] Bug in File::Find when options hash is used with find

Thread Previous | Thread Next
Kunkee, Steve
December 10, 2004 15:22
RE: [perl #32993] Bug in File::Find when options hash is used with find
Message ID:
I would not have thought anyone would consider 5.8.0 'very' old compared
to 5.8.6. But anyway...
I checked the version of the perl documentation, and it clearly
identifies itself as 5.8.0. Here is a piece of the doc page on find:
File::Find(3)                   perl v5.8.0
 User Contributed Perl Documentation     User Contributed Perl


      File::Find - Traverse a directory tree.

          use File::Find;
          find(\&wanted, @directories_to_search);
          sub wanted { ... }

          use File::Find;
          finddepth(\&wanted, @directories_to_search);
          sub wanted { ... }

          use File::Find;
          find({ wanted => \&process, follow => 1 }, '.');

      These are functions for searching through directory trees doing
      on each file found similar to the Unix find command.  File::Find
      exports two functions, "find" and "finddepth".  They work
      but have subtle differences.

            find(\&wanted,  @directories);
            find(\%options, @directories);

As you can see, it is 5.8.0 and it shows a hash for the first argument.
We use the same version on Windows, AND THE OPTION HASH WORKS THERE!!!
I say it is a bug.

-----Original Message-----
From: Steve Peters via RT [] 
Sent: Friday, December 10, 2004 1:54 PM
To: Kunkee, Steve
Subject: [perl #32993] Bug in File::Find when options hash is used with

> [ - Fri Dec 10 10:06:08 2004]:
> This is a bug report for perl from,
> generated with the help of perlbug 1.34 running under perl v5.8.0.
> -----------------------------------------------------------------
> [Please enter your report here]
> When I use find (File::Find) with the options hash, as illustrated in
>    the
> code I have included here, it fails on HP but works on Windows. The
>    message
> I get is
>     Not a subroutine reference at
>    /usr/local/lib/perl5/5.00502/File/ line 197.

The Perl you are using at /usr/local/bin/perl is a very old Perl.  It
did not take an options hash reference as an argument.  It would only
take a subroutine reference for the first argument to find().  Instead,
please try again using the Perl running the perlbug program.  This is
not a bug in Perl.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About