module Parser; use strict; use Parse::RecDescent; $::RD_AUTOACTION = q { ... }; # default action code goes here my $grammar = q { # tokens / productions / actions }; # grammar constructed at compile time my $parser = new Parse::RecDescent($grammar) or die "Bad grammar!\n"; sub parse_address { my $address = shift; return $parser->address($address); } 1;