You don't, as you've declared $checksyntax as a lexical in the block enclosing init_parser. It's only visible to the code literally between the outer two {}'s in your example. You probably want to declare it with our $checksyntax, then it would be accessable as $TelnetClient::Functions::checksyntax elsewhere.
Addendum: An alternative to using package variables would be to implement some variant of the Builder pattern. You have a interface which your grammar calls when it recognizes chunks, and you pass different implementors of that interface (one which builds a syntax tree, the other which does nothing as just a check that the input is valid, etc.). Consult your copy of the GangOfFour book for more details.
In reply to Re: Package variables and Parse::RecDescent
by Fletch
in thread Package variables and Parse::RecDescent
by castaway
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |