in reply to Recursive opendir without
These are the important changes:use strict; my $dir = "/"; my $file; sub openNewDir { my $dir = shift; my $dh; opendir ($dh, $dir); while ($file = readdir ($dh)) { next if (($file eq '.') || ($file eq '..')); if (-d "$dir/$file") { openNewDir("$dir/$file"); } else { # Do something with the file } } close ($dh); } openNewDir ($dir);
-Ton
-----
Be bloody, bold, and resolute; laugh to scorn
The power of man...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Recursive opendir without
by bobione (Pilgrim) on Apr 11, 2001 at 18:29 UTC | |
by tye (Sage) on Apr 11, 2001 at 19:45 UTC | |
by bobione (Pilgrim) on Apr 11, 2001 at 21:52 UTC | |
by tilly (Archbishop) on Apr 12, 2001 at 06:04 UTC | |
by bobione (Pilgrim) on Apr 12, 2001 at 15:28 UTC | |
by jeroenes (Priest) on Apr 11, 2001 at 19:58 UTC |