while(@fnames) { my $f = shift @fnames; next if(-l $f); for my $f2 (@fnames) { next if(-l $f2); #### @fnames = grep { ! -l $_ } @fnames;