I'm trying to figure out how to use File::Find to print the names of all
the files in selected directories below my working directory, but when I
run the following script with more than one directory name listed on the
command line, as in:
$ ./find_practice dir1 dir2
or
$ ./find_practice dir*
...I get no output at all.
Here's the script:
-------------------------------------
#!/usr/bin/perl
use strict;
use File::Find;
@ARGV = qw(.) unless @ARGV;
print "@ARGV\n";
find sub {
print "currently reporting from: $File::Find::dir\n";
print "$File::Find::name\n";
}, "@ARGV";
-------------------------------------
This works find with no command line arguments. Doesn't "@ARGV" contain
a list of arguments, which in this case are directories to be traversed?
Clues greatly appreciated.
Peter
--
1 + 2 = 3; therefore, 4 + 5 = 6
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]