develooper Front page | perl.perl5.porters | Postings from January 2004

Re: [perl #25655] bleadperl triggers new warnings in Regexp::Common

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
January 31, 2004 14:52
Subject:
Re: [perl #25655] bleadperl triggers new warnings in Regexp::Common
Message ID:
20040131224804.GC20819@fdisolutions.com
On Thu, Jan 29, 2004 at 07:39:59AM -0000, David Dyck wrote:
> Recent bleading edge version have started causing
> Regexp::Common to start issuing warnings that they
> didn't before.
> 
> $ perl -we 'use Regexp::Common'
> Variable "$s" is not available at (re_eval 47) line 1.
> Variable "$x" is not available at (re_eval 47) line 1.
> 
> Does this indicate a bug in perl or in Regexp::Common?
> (the error message makes it a bit difficult to
>  identify the offending line(s) of code.
> 
> make test with Regexp-Common-2.113 passes all test, but
> it too issues many warnings during the tests.
> 
> It looks like the warning is comming from
>     Regexp-Common-2.113/lib/Regexp/Common/comment.pm
> 
> in code like:
> 
> 	sub {
>             use re 'eval';
>             my ($s, $x);
>             my $re = qr {\b([A-Za-z]+)\b
>                          (?(?{($s, $x) = (0, lc $^N);
>                               $s += $Regexp::Common::comment::scores
>                                     [ord (chop $x) - ord ('a')] while length $x;
>                               $s  >= 5 && $s < 18})XXX|)}x;
>             $re;
>         };

Well, the use of lexical variables in conjunction with (?{...})
is currently highly buggy. My recent closure patches to bleedperl
now tend to cause warnings where before things just silently did the wrong
thing.

It's on my List Of Things To Do, but probably not any time soon (since the
regex engine scares the life out of me).


-- 
But Pity stayed his hand. "It's a pity I've run out of bullets",
he thought. - "Bored of the Rings"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About