<[EMAIL PROTECTED]> writes: > Just to rephrase my question. > >>From my grammar I can save the parsed out data into global variables, > like $::subdirs or $MyModule::subdirs. That works fine. > > But how can I do it in OO-way, i.e. save data to $obj1->{subdirs} and then > parse another input text by the same parser and save it to $obj2->{subdirs} ?
my $g = new Parse::RecDescent <<'EOG'; thing: dir(s) dir: /some_regex/ { $thisparser->{DATA}->subdirs($item[1]) } EOG $g->{DATA} = new Obj; $g->thing($text); print $g->{DATA}->subdirs(); $g->{DATA} = new Obj; $g->thing($text); print $g->{DATA}->subdirs(); # ... /s