#!/usr/bin/perl -w
use strict;
my $dir = shift;
opendir DIR, $dir or die "Can't open $dir: $!";
foreach my $file ( grep /\.asp$/i, readdir DIR ) {
my $target = "\n" .
"
\n" .
"[^>]*<\/title>\n" .
"\n" .
"<\/head>\n\n" .
"";
my $target2 = "\n" .
"\n" .
"[^>]*<\/TITLE>\n" .
"\n" .
"<\/HEAD>\n" .
"";
my $replace = "";
print "Changing $dir\\$file...";
open FILE, "$dir\\$file" or die "Can't open $dir\\$file: $!";
my $text;
{
local $/ = undef;
$text = ;
}
$text =~ s/$target/$replace/;
$text =~ s/$target2/$replace/;
close FILE;
open FILE, ">$dir\\$file";
print FILE $text;
close FILE;
print "Done.\n";
}
closedir DIR;