123456789101112131415161718
#!/usr/bin/perluse warnings;use strict;my $Verzeichnis = "d:\\";opendir(DIR, $Verzeichnis) or die $!;my @files = readdir(DIR);closedir(DIR) or die $!;print join("\n", @files);foreach (@files) {# code} # foreach