in reply to I don't use glob, I use readdir
in thread Getting a List of Files Via Glob
&makeTree(0,'/where/to/start'); sub makeTree { my ($level,$Dir)=@_; # Get all directories opendir(DIR,$Dir) || die "$!"; my @Dirs = grep { /^[^.].*/ && -d "$Dir/$_" } readdir(DIR); closedir(DIR); # Read files and do stuff or whatever... # Call self foreach my $currDir (@Dirs) { &makeTree($level+1,join('/',$Dir,$currDir)); } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Descending through directories
by Corion (Patriarch) on May 30, 2000 at 15:12 UTC | |
by t0mas (Priest) on May 30, 2000 at 17:27 UTC | |
by Corion (Patriarch) on May 30, 2000 at 19:54 UTC | |
by t0mas (Priest) on Jun 02, 2000 at 00:20 UTC | |
by Corion (Patriarch) on Jun 02, 2000 at 11:58 UTC | |
| |
by Corion (Patriarch) on Jun 04, 2000 at 05:13 UTC | |
| |
by Corion (Patriarch) on Jun 02, 2000 at 01:45 UTC | |
| |
by softworkz (Monk) on May 29, 2001 at 17:04 UTC | |
by Corion (Patriarch) on Jun 02, 2000 at 01:46 UTC | |
by t0mas (Priest) on May 31, 2000 at 10:22 UTC |