in reply to Variables and Scope: The battle begins

If time is of the essence, why not utilise the depth of knowledge already in CPAN e.g. Parse::RecDescent, or has this become a problem that you now have to solve for yourself ?

Just a(nother:-) thought ...

A user level that continues to overstate my experience :-))
  • Comment on Re: Variables and Scope: The battle begins

Replies are listed 'Best First'.
Re^2: Variables and Scope: The battle begins
by VincentK (Beadle) on Dec 12, 2013 at 16:42 UTC
    To expand on this great suggestion from Bloodnok, I found a nice tutorial for the parser.

    http://www.perl.com/pub/2001/06/13/recdecent.html

    From

    http://www.perlmonks.org/?node_id=108182

    Sample code from the tutorial.

    use strict; use warnings; use Parse::RecDescent; # Create and compile the source file my $parser = Parse::RecDescent->new ( q( startrule : day month /\d+/ day : "Sat" | "Sun" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri +" month : "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec" ) ); # Test it on sample data print "Valid date\n" if $parser->startrule("Thu Mar 31"); print "Invalid date\n" unless $parser->startrule("Jun 31 2000");
      I will check these out, thank you.