$whole_thing =~
m|<some unique html start string>(.*?)<end string>|s;
$good_chunk = $1;
The matching could fail here, so you should check before using
$1, otherwise you'll get the value remaining from the previous positive evaluation. You could also evaluate in list context:
($good_chunk) = $whole_thing =~
m|<some unique html start string>(.*?)<end string>|s;
even if readability could suffer a bit here. This will assign
$1 to
$good_chunk if the regex matches,
undef otherwise.
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
Don't fool yourself.