Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Why won't this basic Parse::RecDescent example work?

by 7stud (Deacon)
on Jan 28, 2013 at 04:23 UTC ( #1015626=note: print w/ replies, xml ) Need Help??


in reply to Why won't this basic Parse::RecDescent example work?

Another variation that doesn't produce the expected output:

our %HASH; my $grammar = <<'END_OF_GRAMMAR'; startrule : from_clause from_clause : 'from' dir(s) { print "-->$item{dir}<--\n"; } dir : "hello" | "world" END_OF_GRAMMAR my $parser = Parse::RecDescent->new($grammar); $parser->startrule("from hello world"); use Data::Dumper; say Dumper(\%HASH); --output:-- --><-- $VAR1 = {};
Expected output:
-->SOMETHING<-- $VAR1 = { "dirs" => "SOMETHING"; };


Comment on Re: Why won't this basic Parse::RecDescent example work?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015626]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2014-09-02 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (18 votes), past polls