On 10 February 2010 10:16, Dan Stahlke via RT
<bug-Parse-RecDescent@rt.cpan.org> wrote:
Show quoted text> Tue Feb 09 18:16:44 2010: Request 54457 was acted upon.
> Transaction: Ticket created by dstahlke@gmail.com
> Queue: Parse-RecDescent
> Subject: $1 is uninitialized at line 2367
> Broken in: 1.963
> Severity: (no value)
> Owner: Nobody
> Requestors: dstahlke@gmail.com
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=54457 >
>
>
> In the following code (which starts at line 2364 of RecDescent.pm)
>
> elsif ($grammar =~ m/$LITERAL/gco)
> {
> ($code = $1) =~ s/\\\\/\\/g;
> _parse("a literal terminal", $aftererror,$line,$1);
> $item = new Parse::RecDescent::Literal($code,$lookahead,$line);
> $prod and $prod->additem($item)
> or _no_rule("literal terminal",$line,"'$1'");
> }
>
> the $1 variable appears to be uninitialized when _parse is called. This
> causes an uninitialized value warning at line 3087 in the _parse function.
>
> I am using perl 5.8.8 on Centos 5. The warning happens when RecDescent
> is called by Google::ProtocolBuffers, apparently only when running under
> mod_perl.
>
Thanks for the report. Fixed for the next release.
In the meantime the patch is to replace the current block with:
elsif ($grammar =~ m/$LITERAL/gco)
{
my $literal = $1;
($code = $literal) =~ s/\\\\/\\/g;
_parse("a literal terminal", $aftererror,$line,$literal);
$item = new Parse::RecDescent::Literal($code,$lookahead,$line);
$prod and $prod->additem($item)
or _no_rule("literal terminal",$line,"'$literal'");
}
Damian
the following:
Damian