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