Peter wrote:
> 
> 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.

Clue 1:
perldoc -q quoting

Clue 2: The second argument to File::Find::find() should be a LIST.

If you need any more clues just ask.  :-)


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to