Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Perl Monk, Perl Meditation

Comment on

Excellent node! I have a couple of questions:
  1. Why do you do [@item[0..$#item]] rather than just [@item]? IIRC, the second will copy the array as well, so there's no need to take a slice.
  2. re: number 15 -- I've noticed that it complains about RD_AUTOACTION when you use Precompile (which is the same as the command-line?), but it seems to still append auto-actions just fine. Is this the behavior you saw?
And finally, one additional suggestion to add: Do as little as possible in your actions, particularly in the ones in lower-level rules. Building up and tearing down parse trees can be awfully slow, so it may be faster to just do the fastest thing possible during the parse, and post-process it afterwards.


In reply to Re: Random Tips on Parse::RecDescent by educated_foo
in thread Random Tips on Parse::RecDescent by hsmyers

and:  <code> code here </code>

  • Please read these before you post! —
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (5)
    As of 2014-03-14 01:30 GMT
    Find Nodes?
      Voting Booth?

      Have you used a cryptocurrency?

      Results (293 votes), past polls