in reply to how do i extract file names that aren't soft links

You would use the -l operator to determine whether a file is a symbolic link. For example:
@non_symlinks = grep { ! -l $_ } @all_files;
If you are also asking how to get the content listing of the directory...
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;
The point of the first grep is to filter out all names that start with dot -- including . and ..

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
    Why do people do the clunky readdir dance when glob() or <*> would do just as nicely in far less space and trouble? In this case, it's even worse, since readdir lists "hidden" files but globbing doesn't.
    my $dirname = 'foo'; my @non_symlinks = grep { not -l } <$dirname/*>;

    --
    [ e d @ h a l l e y . c c ]