Skip to content

Instantly share code, notes, and snippets.

Created August 1, 2011 02:15
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 anonymous/1117468 to your computer and use it in GitHub Desktop.
Save anonymous/1117468 to your computer and use it in GitHub Desktop.
walks a directory structure
@queue = ('.');
while(my $path = shift(@queue)) {
if(-d $path) {
opendir D, $path;
foreach(readdir D) {
push @queue, "$path/$_" unless /^\.\.?$/;
}
closedir D;
next;
}
print "$path\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment