Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
open (FILE, $filename); while(<FILE>){ # walk each file my $line = $_ ; chomp $line; #grabbing and printing everything between the body tags if (/<body.*?>/i ... /<\/body.*?>/i){ # this is a body line # extract the body ##Changing .html to .asp at the end of every link that does no +t belong to an external link if ($_ !~ m/href=\"http:\/\/.+\.html/) { s/(href=.+?\.)html/$ +1asp/gi } ###this is where i need to find and delete those certai +n include files $body_temp = $_; $body_temp =~ s/(.*?)\<body\>(.*?)\<\/body\>/$2/i; chomp($body_temp); $body = "$body_temp" ; # Write the body to the output file print OUTFILE $body . "\n"; } } close(FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Removing include files
by AidanLee (Chaplain) on May 02, 2001 at 20:31 UTC | |
by arturo (Vicar) on May 02, 2001 at 21:40 UTC | |
|
Re: Removing include files
by converter (Priest) on May 02, 2001 at 22:53 UTC |