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(".."); }