RE: Line contination characters - how do I access these variables - SUMMARY
[email protected] Wed, 26 Jun 2002 10:18:35 -0700
| Newsgroups | perl.recdescent |
|---|---|
| Message-ID | <[email protected]> |
> This leads to my next question. Since the returned hash does not have a
> name, how do I access it? Who is it returned to?
Thank to proding from Yves, I figured it out:
my $parser = Parse::RecDescent->new($grammar);
my $out = $parser->startrule( $text );
# before I was calling the parser as:
# $parser->startrule( $text );
# I was not saving any of the information.
# Nexted I used Dumper to figure out what format the data was in
print Dumper($out);
# I found out it was an array and was able to access the hash
print "$out->[1]{comment} \n";
print "$out->[2]{command} \n";
Thanks again,
jr