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 perusing the Monastery: (7)
As of 2015-07-30 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls