Ovid has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File::Find Woes
by japhy (Canon) on Oct 25, 2000 at 03:53 UTC | |
|
Re: File::Find Woes
by runrig (Abbot) on Oct 25, 2000 at 03:54 UTC | |
|
Re: File::Find Woes
by d_i_r_t_y (Monk) on Oct 25, 2000 at 08:30 UTC | |
|
RE: File::Find Woes
by OzzyOsbourne (Chaplain) on Oct 25, 2000 at 15:18 UTC | |
|
RE: File::Find Woes
by OzzyOsbourne (Chaplain) on Oct 25, 2000 at 15:18 UTC | |
|
(Ovid) Re: File::Find Woes
by Anonymous Monk on Oct 25, 2000 at 21:51 UTC |