use strict; use Parse::RecDescent; use Data::Dumper; # ORL 13 Sauls kicked off 71 yards from the ORL30 my $grammar = q { <autotree> file : play(s) play : side number player action action : kick | run kick : 'kicked off' number 'yards from the' sideyard run : 'ran' number 'yards' side : /\w+/ player : /\w+/ number : /\d+/ sideyard : /\w+\d+/ }; my $parser = new Parse::RecDescent ($grammar); my $ret = $parser->file("ORL 13 Sauls kicked off 71 yards from the ORL +30"); print Data::Dumper->Dump([$ret], [qw(ret)]);
In reply to Re: Parsing a Log File
by tall_man
in thread Parsing a Log File
by PrimeLord
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |