$dir = path to the directory opendir (DIR,$dir) or die "dead"; while(my $text = readdir DIR) { print "$file\n" } #### . .. File.txt