Jenda Krynicky schreef:

> The thing is that if you use
>
>  $something =~ /^$regex$/;
>
> in a loop, Perl has to copile the regular expression for each
> iteration. Because it can't know whether the $regex variable
> is still the same or not.

(assuming C<my $regex;>)
I wouldn't directly know how to test it, but I think that (in recent
Perls) the /^$regex$/ is only recompiled if one of its parts is actually
changed (where C<$regex = $regex;> is a counted as a change).
(this also makes the /o almost obsolete)

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to