in reply to recurse directories and sub-directories
Just a qwik copy & paste .. scuse errors/ommissions the 'qif;sub handle_dir { my $d = shift; my $sd = shift || ''; my @all = (); opendir (DIR, $d) or die "Broken!"; while (defined(my $file = readdir(DIR))) { push @all, $file; } chdir ($d); foreach my $file (@all) { next if $file =~ /^\.$/; next if $file =~ /^\.\.$/; my $fp = $d . "\\" . $file; if ($file =~ /htm$/i) { &handle_html ($fp); } if (-d $file) { &handle_dir ($fp); } chdir($d); } chdir(".."); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: recurse directories and sub-directories
by tomhukins (Curate) on Oct 12, 2001 at 16:19 UTC | |
by grinder (Bishop) on Oct 12, 2001 at 16:38 UTC | |
by dkubb (Deacon) on Oct 12, 2001 at 18:43 UTC | |
|
Re: Re: recurse directories and sub-directories
by zuqif (Hermit) on Oct 12, 2001 at 17:12 UTC |