in reply to Putting all the files in an array
As you said "unique header files in cwd" I suppose you mean recursively, starting from the cwd (as filenames are always unique per directory).
use File::Find; my @headers; my %seen; find(sub { push @headers, $_ if -f && /\.h$/ && !$seen{$_}++; }, ".");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Putting all the files in an array
by Anonymous Monk on Mar 20, 2011 at 12:31 UTC | |
by Corion (Patriarch) on Mar 20, 2011 at 12:47 UTC |