Skip to content

Instantly share code, notes, and snippets.

@takus
Created October 9, 2011 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takus/1273496 to your computer and use it in GitHub Desktop.
Save takus/1273496 to your computer and use it in GitHub Desktop.
Find all files in a directory
opendir DH, $dir or die "Error: can't open $dir : $!";
while (my $file = readdir DH) {
next if $file =~ /^\.{1,2}$/;
print $file, "\n";
}
closedir DH;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment