"be consistent" | |
PerlMonks |
Re: Parse::RecDescent grammar definitionby Anonymous Monk |
on Mar 21, 2011 at 14:39 UTC ( [id://894529]=note: print w/replies, xml ) | Need Help?? |
FYI, I found it very useful to define a module of utility subroutines to do various things to the result variables (for instance) which I "use" within the grammar (generated...) code. If I always want a list, for example, but the parser might in some cases hand me undef or a scalar, an appropriate utility sub can easily make that a non-issue and always do the right thing. "Using" them provides consistency and avoids repetition of source code.
In Section
Seekers of Perl Wisdom
|
|