gnu@perl has asked for the wisdom of the Perl Monks concerning the following question:
Any ideas on how I can do this without using a glob?
Below is the subroutine that is doing the work. The glob is what is passed in to the sub (in @_). It should be noted that this sub works fine on the 5.6.0 box, it just blows up on the glob in a 5.005_3 version of perl.
sub { my @files = map { chomp; (< $_ >) } @_; my $return; if (!@files){ $return=0; } else { while (@files){ if (! -f $_){ $return=0; } print "\t Found files:\n\t " . join (",\n\t ", @files) . "\n" if ($DEBUG); $return=1; return $return; } } };
TIA, Chad.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: opendir on file glob
by gnu@perl (Pilgrim) on Sep 26, 2002 at 19:41 UTC |