while (<>) { chomp; next unless -f $_; # ignore specials #... }