in reply to Removing duplicate line
I would have done it like that :
undef $/; # to absorb the whole file in a single read. open FILE, $filename; $all = <FILE>; $all =~ s/\.html/\.asp/g; # this will substitue the .html to .asp glob +ally # this takes the part in between the body tags... $all =~ s{^.*?\<body.*?\>(.*)\</body.*?\>.*?$} {$1}isx; print OUTFILE $all; close FILE;
|
|---|