--- trunk/lib/Frey/PPI.pm 2008/11/16 19:50:36 364 +++ trunk/lib/Frey/PPI.pm 2008/11/18 14:15:45 414 @@ -19,8 +19,8 @@ lazy => 1, default => sub { my ( $self ) = @_; - warn "doc from ", $self->class; - my $doc = PPI::Document->new( $self->class_path( $self->class ) ) || die $!; + warn "# doc from ", $self->class if $self->debug; + my $doc = PPI::Document->new( $self->class_path( $self->class ) ); $doc->prune('PPI::Token::Whitespace'); return $doc; }, @@ -40,18 +40,19 @@ sub attribute_order { my ( $self ) = @_; - my $attribute_order; + my @attribute_order; $self->find(sub { my ($doc,$el) = @_; return unless ( $el->isa('PPI::Statement') && $el->{children}->[0]->isa('PPI::Token::Word') && $el->{children}->[0]->literal eq 'has' ); warn "## has ",$el->{children}->[1]->literal if $self->debug; - push @$attribute_order, $el->{children}->[1]->literal; + push @attribute_order, $el->{children}->[1]->literal; }); - warn "# ", $self->class, " attribute_order ", dump( $attribute_order ) if $self->debug; + warn "# ", $self->class, " attribute_order ", dump( @attribute_order ) if $self->debug; - return $attribute_order; + return @attribute_order if wantarray; + return \@attribute_order; } sub includes {