Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to grab Parse::RecDescent error output in a variable?

by ikegami (Pope)
on Sep 12, 2008 at 10:20 UTC ( #710872=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Parse::RecDescent qw( );
    ...
    open(local *Parse::RecDescent::ERROR, '>', \my $error);
    my $p = Parse::RecDescent->new($grammar) or die "Invalid grammar";
    my $output = $p->startrule($str) or die $ParseError;
    
  2. or download this
    print("d");
    BEGIN {
    ...
    }               # outer BEGIN     executed after this line is compiled
    print("e");
                    # outermost scope executed after this line is compiled
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2014-10-26 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (152 votes), past polls