On Aug 16, 4:37 am, [EMAIL PROTECTED] (Dr.Ruud) wrote:
> Paul Lalli schreef:
>
> > s/$h1_sec/$mod_sec/; #replace the pattern found with the
> > modified version
>
> Many s/$search/replace/ constructs should have been written with
> quotemeta, so that they look like:
>
> s/\Q${search}/replace/
Many, sure. But not this one. If you actually read the whole code,
you'll see there's no way for $h1_sec to contain any meta characters,
and so there is no reason to put the \@ there.
Since you snipped it, here it is again:
if (m!(<h1>(?:[a-z]+-)+[a-z]+</h1>)!i) {
$h1_sec = $1;
($mod_sec = $h1_sec) =~ tr/-/ /;
s/$h1_sec/$mod_sec/;
}
As you can see, the only possible characters that can be in $h1_sec
are:
letters, 1, -, <, >, and /
None of those need to be escaped.
Paul Lalli
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/