use strict; use warnings; my $scan; opendir $scan, '.'; while (my $entry = readdir ($scan)) { next if ! -f $entry; # Skip if not a file print "$entry\n"; }