John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
No matter what I give as the argument, it gives me three errors about concatenating undefined values on the print line, and: Can't use string ("1") as a subroutine ref while "strict refs" in use at I:/Program Files/Languages/Perl5/lib/File/Find.pm line 822. and this only happens once, so the find is not iterating over all the files in the directory. Please help an old monk? --John Active Perl build 816 running on WinXP Pro.use v5.8.8; use strict; use warnings; use File::Find; sub wanted { # $File::Find::dir is the current directory name, # $_ is the current filename within that directory # $File::Find::name is the complete pathname to the file. print "[$File::Find::dir], [$_], [$File::Find::name]\n"; } sub main() { my $arg= shift @ARGV; print $arg, "\n"; find ({wanted => &wanted }, $arg); } main;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File:Find doing weird stuff
by idsfa (Vicar) on Mar 23, 2006 at 05:55 UTC |