Subject: | PPI::Statement::Variable::variables breaks for lists with leading whitespace |
MIME-Version: | 1.0 |
X-Mailer: | MIME-tools 5.418 (Entity 5.418) |
X-RT-Original-Encoding: | utf-8 |
Content-Type: | multipart/mixed; boundary="----------=_1158734464-10294-3" |
Content-Length: | 0 |
Content-Type: | text/plain; charset="utf8" |
Content-Disposition: | inline |
Content-Transfer-Encoding: | binary |
Content-Length: | 290 |
Variables are not correctly parsed by
PPI::Statement::Variable::variables when those variables are contained
in a list and the list has whitespace prior to the first variable.
e.g.:
my ($self, $param) = @_; # ok
my ( $self, $param ) = @_; # not ok
I have attached a patch to remedy this.
Subject: | variable_patch.txt |
MIME-Version: | 1.0 |
Content-Type: | multipart/mixed; boundary="----------=_1158734464-10294-2" |
X-Mailer: | MIME-tools 5.418 (Entity 5.418) |
Content-Length: | 0 |
Content-Type: | text/plain; charset="utf8" |
Content-Disposition: | inline |
Content-Transfer-Encoding: | binary |
X-RT-Original-Encoding: | utf-8 |
Content-Length: | 0 |
Content-Type: | text/plain; charset="utf-8"; name="variable_patch.txt" |
Content-Disposition: | inline; filename="variable_patch.txt" |
Content-Transfer-Encoding: | binary |
X-RT-Original-Encoding: | ascii |
Content-Length: | 452 |
--- Variable.pm 2006-09-19 23:32:05.160950100 -0700
+++ Variable.pm 2006-09-19 23:31:55.232668100 -0700
@@ -135,7 +135,7 @@
# If it's a list, return as a list
if ( _INSTANCE($schild[1], 'PPI::Structure::List') ) {
- my $Expression = $schild[1]->child(0);
+ my $Expression = $schild[1]->schild(0);
$Expression and
$Expression->isa('PPI::Statement::Expression') or return ();