in reply to Re: aliasing !! and Parse::RecDescent?
in thread aliasing !! and Parse::RecDescent?
this mean I have to write directly into $$obj{_data} array during the parse..my $obj = new Parser(); $obj->parse; print "$_\n" for @{$$obj{_data}};
havent tested..is this the correct way of doing it ?! what bothers me in this variant is that $ref can be overwriten from different objects..(which can be problem in multiuser env., not that i will use it in such way but who know :"))package Parser; our $ref; my $grammar = q{ { my $data = $ref } start : ..... ruleX : blah hmm { push @{$$data{_data}}, $item[2] } } sub parse { my $self = shift; $ref = $self{_data}; $parser = new Parse::RecDescent; $parser->start($$self{str}) ... }
|
|---|