McMahon has asked for the wisdom of the Perl Monks concerning the following question:
I assumed that this would populate @ARGV with only filenames, and not top-level directory names. However, subdirectory names are getting into @ARGV somehow:{ my @starters = @ARGV ? @ARGV : 'F:/test'; @ARGV = (); find sub { if (($_ =~ ".c") or ($_ =~ ".h")) { push @ARGV, "$File::Find::dir/$_"; } }, @starters; } while (<>) { ... }
Can anyone explain to me how those top-level subdirectory names got into @ARGV when I only ever pushed "$File::Find::dir/$_" onto the array? Thanks! -ChrisCan't do inplace edit: F:/test/subdir is not a regular file at script. +pl line 28
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: strange File::Find thing?
by chip (Curate) on Mar 22, 2004 at 20:40 UTC | |
by McMahon (Chaplain) on Mar 22, 2004 at 20:44 UTC | |
|
Re: strange File::Find thing?
by etcshadow (Priest) on Mar 22, 2004 at 20:38 UTC |