|
|
1.1 paf 1: #!/usr/bin/perl
2: undef $/;
3:
4: scandir("./",*action);
5:
6: sub action {
7: $file=@_[0];
8: print "$file\n";
9:
10: open(FILE, $file);
11: $_=<FILE>;
12: close($file);
13:
14: s/\.html/.htm/sg;
1.2 ! paf 15: # s/(\<head\>)/$1<meta http-equiv="Content-Type" content="text\/html;charset=Windows-1251">/;
1.1 paf 16: s/(Language=)/;$1/;
17:
18: open(FILE, ">$file");
19: print FILE $_;
20: close($file);
21: }
22:
23: sub scandir {
24: local($Dir, *Sub) = @_;
25:
26: opendir Dir, $Dir;
27: local(@Dir) = readdir Dir;
28: closedir Dir;
29:
30: foreach $ProcessFiles (1, 0) {
31: foreach $FileName (@Dir) {
32: next if $FileName =~ /^\./;
33:
34: $FullName = $Dir.$FileName;
35:
36: if ($ProcessFiles) {
37: $TotalCount++;
38: Sub($FullName) if (!-d $FullName && $FileName =~ /(^tree\.htm|\.hh.)$/);
39: } else {
40: scandir("$FullName/") if -d $FullName;
41: }
42: }
43: }
44: }