|
[text/plain 1.5k]
On Tue, Aug 11, 2009 at 12:49 PM, osfameron via
RT<bug-XML-Twig[...]rt.cpan.org> wrote:
> Tue Aug 11 06:49:52 2009: Request 48616 was acted upon.
> Transaction: Ticket created by OSFAMERON
> Queue: XML-Twig
> Subject: twig handler 'foo/*' causes syntax-error in eval
> Broken in: 3.32
> Severity: Important
> Owner: Nobody
> Requestors: osfameron[...]cpan.org
> Status: new
> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48616 >
>
>
> Ciao Michel,
>
> If I create a twig_handler with an xpath including a '*', like so:
>
> my $t = XML::Twig->new(
> twig_handlers => {
> 'foo/*' => sub { },
> }
> );
>
> the new() call immediately exits with what looks like errors in codegen:
>
> wrong handler condition '' (syntax error at (eval 13) line 11, near "( ) "
> Global symbol "@new_current_elts" requires explicit package name at
> (eval 13) line 13.
> syntax error at (eval 13) line 13, near ") {"
> Global symbol "@current_elts" requires explicit package name at (eval
> 13) line 14.
> <snip more Global symbol errors>
> syntax error at (eval 13) line 26, near ";
> }"
> (eval 13) has too many errors
>
> I'm uncertain if the xpath syntax I'm trying to pass is
> unexpected/wrong, but I guess this error isn't intended in any case ;-)
Ciao,
I can't believe I never tested this! Indeed the generated code is if()
{ ...} which for some reason perl doesn't quite like.
if(1) {... should work instead
Fix and tests are on their way.
Thanks for the bug report.
--
mirod
--
mirod
|