Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Parse::RecDescent and auto{actions,trees} and stuff

by pc88mxer (Vicar)
on Jul 16, 2008 at 14:33 UTC ( [id://698003]=note: print w/replies, xml ) Need Help??


in reply to Parse::RecDescent and auto{actions,trees} and stuff

Your autoaction is returning 1 instead of, perhaps, $item[1]. The 1 is the return value of the print statement in your autoaction code. That's why you are seeing in your output:
int=10 time=1 int=12 load=1 ...
instead of:
int=10 time=10 int=12 load=12 ...

Also, in your case you can safely remove the assignments to $return from your code. Assigning to $return is useful if, for instance, the return value is determined by an action block which is not the last:

production: stuff { $return = ... } and other { ... } things { ... }
Normally the return value would be whatever is returned by the action following things, but in this case it is set by the code in the action following stuff.

Replies are listed 'Best First'.
Re^2: Parse::RecDescent and auto{actions,trees} and stuff
by mattford63 (Sexton) on Jul 16, 2008 at 14:56 UTC
    Hi,

    Well that explains things nicely and fixs for me my autoaction issue :-)

    But any idea why autotree won't work ?

    :-(
      <autotree> only specifies actions for those rules which don't already have actions.
        I get the fact it only works for rules without actions (but I could be missing something here). But I don't get why it breaks my code and stops the recursion as it shouldn't affect the custom case...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found