6 my $source = shift @ARGV || die "usage: $0 source.html filtered.html";
7 my $dest = shift @ARGV || die "usage: $0 source.html filtered.html";
9 die "$0: cannot read $source";
12 die "$0: file exists! $dest";
15 open SOURCE, "<$source";
21 my $startre = '<script\b[^>]*>';
22 my $endre = '</script>';
24 while (my $line = <SOURCE>) {
25 while ($line =~ /$startre/) {
26 $line =~ /^(.*?)$startre(.*)(\r?\n)$/;
34 while ($line =~ /$endre/) {
35 $line =~ /^(.*?)$endre(.*)(\r?\n)$/;
37 warn "$0: something wrong";
43 if ($line && $inscript <= 0) {