It displays the following:#!D:/perl/bin/perl.exe -w use strict; use File::Find; my @list = qw(.); find ( \&recurse, @list ); sub recurse { my $file = $File::Find::name; productionize ( $file ); } sub productionize { my $fileName = shift; return if $fileName !~ /[\w]+\.(?:cgi|p[lm])$/; print "Processing $fileName\n"; open FILE, "<$fileName" or die "Can't open $fileName for reading: +$!"; #do stuff close FILE; }
As soon as I try to descend into a sub directory, it chokes. I keep reading through the documentation and I assume that I'm overlooking something simple. What am I missing?Processing ./blobtest.pl Processing ./form.pl Processing ./functional.pl Processing ./images.cgi Processing ./index.pl Processing ./upload.cgi Processing ./utils/debug.pl Can't open ./utils/debug.pl for reading: No such file or directory at +correct.pl line 17.
NT 4.0, service pack 6. ActiveState Perl v5.6.0.
Humbly yours,
Ovid
P.S. For those who might wonder why I've bothered to call productionize() from recurse(): the code is actually considerably more complicated. I simply have a very simple test case here.
Join the Perlmonks Setiathome Group or just go the the link and check out our stats.
In reply to File::Find Woes by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |