Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PPI CPAN distribution.

Report information
The Basics
Id: 14436
Status: resolved
Worked: 4 hours (240 min)
Priority: 0/
Queue: PPI

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

Bug Information
Severity: Normal
Broken in: 1.003
Fixed in: (no value)



Subject: ->variables fails for C< my ($foo) = ... >
->variables isn't smart enough about the following snippit. my ($foo, $bar) = ...; It needs to be enhanced to support it.
From: perl [...] renee-baecker.de
[ADAMK - Sat Sep 3 06:07:14 2005]: Show quoted text
> ->variables isn't smart enough about the following snippit. > > my ($foo, $bar) = ...; > > It needs to be enhanced to support it.
The following code works... It's a patch for PPI::Statement::Variable sub variables { my $self = shift; # Get the children we care about my @schild = grep { $_->significant } $self->children; shift @schild if isa($schild[0], 'PPI::Token::Label'); # If the second child is a symbol, return its name if ( isa($schild[1], 'PPI::Token::Symbol') ) { return $schild[1]->canonical; } # If it's a list, return as a list if ( ref($schild[1]) eq 'PPI::Structure::List' ) { my @array = grep{$_->significant}$schild[1]->children; my $symbols = $array[0]->find('PPI::Token::Symbol') or return (); return map { $_->canonical } @$symbols; } # erm... this is unexpected (); } Regards, Renee Baecker
From: perl [...] renee-baecker.de
Show quoted text
> # If it's a list, return as a list > if ( ref($schild[1]) eq 'PPI::Structure::List' ) {
This should be if(isa($schild[1],'PPI::Structure::List')){