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
From:
Kunkee, Steve
Date:
December 10, 2004 15:22
Subject:
RE: [perl #32993] Bug in File::Find when options hash is used with find
Message ID:
6C9FC94A5D0F6F488A6937F0F13E7956958813@usslmplm003.net.plm.eds.com
Steve,
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
File::Find(3)
 User Contributed Perl Documentation     User Contributed Perl
Documentation

                                 2003-06-19



 NAME
      File::Find - Traverse a directory tree.

 SYNOPSIS
          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 }, '.');

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

      find
            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.
Steve

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

> [kunkee@ugs.com - Fri Dec 10 10:06:08 2004]:
> 
> This is a bug report for perl from kunkee@ugs.com,
> 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/Find.pm 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


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