Subject: Too much information for $1? · Posted: 2006-03-30, 01:54am
Rank: ? (1)
Member #: 27071
I am writing a program that deletes the text between a start point and an end point. This is off a webpage, so the line I am aiming for is extremly long. I wrote the code:
Code:
@ARGV=$dir.$htmlFile;
$^I=".bk";
while (<>) {
m/$clipStart(.*?)$clipEnd/;
$inBetween = $1;
if ($inBetween)
{
s/$inBetween//;
}
print;
}
}
This works fine when what is returned in $1 isn't too big. But one file where there is a lot of text between $clipStart and $clipEnd, $1 doesn't seem to get all of it. Is there a workaround for this?