in reply to how do i extract file names that aren't soft links
If you are also asking how to get the content listing of the directory...@non_symlinks = grep { ! -l $_ } @all_files;
The point of the first grep is to filter out all names that start with dot -- including . and ..my $dirname = 'foo'; opendir D, $dirname or die "read $dirname - $!"; my @visible_files = grep !/^\./, readdir D; closedir D; my @non_symlinks = grep { ! -l "$dirname/$_" } @visible_files;
jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: how do i extract file names that aren't soft links
by halley (Prior) on Apr 01, 2004 at 18:10 UTC |