David T-G wrote at Fri, 07 Jun 2002 16:45:38 +0200:
> I'm not sure about the ignore case... If I read it right, some $pattern will become
> "(?i)$pattern". I guess, then, (?i)pat is like /pat/i otherwise?
>
Yep.
The (?i) switches ignorecase in regexes on,
while (?-i) switches it off.
You coul
Janek, et al --
...and then Janek Schleicher said...
%
% Nikola Janceski wrote at Fri, 07 Jun 2002 15:02:22 +0200:
%
% > perhaps use qr// to "precompile" the search instead and use that new precompiled
var within your
% > loop so you don't evaluate the if conditions each looptime.
...
%
% Eve
Nikola Janceski wrote at Fri, 07 Jun 2002 15:02:22 +0200:
> perhaps use qr// to "precompile" the search instead and use that new precompiled var
>within your
> loop so you don't evaluate the if conditions each looptime.
>
> my $search;
>if ( $WholeMatchOnly )
>{
> if ( $IgnoreCase
Nikola, et al --
...and then Nikola Janceski said...
%
% perhaps use qr// to "precompile" the search instead and use that new
% precompiled var within your loop so you don't evaluate the if conditions
% each looptime.
Oh, cool! Thanks!
%
% my $search;
...
Thanks also for the example, since
perhaps use qr// to "precompile" the search instead and use that new
precompiled var within your loop so you don't evaluate the if conditions
each looptime.
my $search;
if ( $WholeMatchOnly )
{
if ( $IgnoreCase )
{ $search = qr/^\($pattern\)$/i }
else
{ $search = qr/