singho has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; my $dirname = <STDIN>; #chomp($dirname); opendir(DIR, $dirname) or die "Can't opendir $dirname : $!\n"; while (defined(my $file = readdir(DIR))) { print "$file\n"; } closedir(DIR);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Traverse a directory
by Corion (Patriarch) on Sep 05, 2012 at 08:08 UTC | |
by singho (Novice) on Sep 05, 2012 at 12:40 UTC | |
by Corion (Patriarch) on Sep 05, 2012 at 12:59 UTC | |
|
Re: Traverse a directory
by zentara (Cardinal) on Sep 05, 2012 at 10:48 UTC | |
|
Re: Traverse a directory
by pvaldes (Chaplain) on Sep 05, 2012 at 16:49 UTC | |
|
Re: Traverse a directory
by asqwerty (Acolyte) on Sep 05, 2012 at 11:47 UTC | |
by Anonymous Monk on Sep 05, 2012 at 14:34 UTC |