Skip Menu |
 

This queue is for tickets about the XML-Twig CPAN distribution.

Report information
The Basics
Id: 48616
Status: resolved
Priority: 0/
Queue: XML-Twig

People
Owner: Nobody in particular
Requestors: osfameron [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.32
Fixed in: 3.33



Subject: twig handler 'foo/*' causes syntax-error in eval
Download (untitled) / with headers
text/plain 813b
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 ;-) Cheers, Hakim
Subject: Re: [rt.cpan.org #48616] twig handler 'foo/*' causes syntax-error in eval
Date: Tue, 11 Aug 2009 16:58:45 +0200
To: bug-XML-Twig [...] rt.cpan.org
From: Michel Rodriguez <xmltwig [...] gmail.com>
Download (untitled) / with headers
text/plain 1.5k
On Tue, Aug 11, 2009 at 12:49 PM, osfameron via RT<bug-XML-Twig@rt.cpan.org> wrote: Show quoted text
> 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
OK, patched version at the usual place: http://xmltwig.com/xmltwig __ mirod


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.