JESii has asked for the wisdom of the Perl Monks concerning the following question:
If I run the script as is, it works. If I uncomment any one of the commented actions above, it fails with the 'undefined value' error.my $grammar = q{ file: hdr body ftr hdr: /^HDR.*\\n/ { print "HDR: $item[1]"; } body: batch(s) ftr: /^FTR.*\\n/ batch: bathdr tran(s) batftr bathdr: /^BHD.*\\n/ { # $str1= substr($item[1],30,3) 1; } tran: TR1 TR2 batftr: /^BFT.*\\n/ TR1: /^TR1.*\\n/ { # $str4= substr($item[1],35,8); # $str2= substr($item[1],122,5); 1; } TR2: /^TR2.*\\n/ { # $str3= substr($item[1],103,2); # print "DATA: $str1, $str2, $str3, $str4\\n"; 1; } };
janitored by ybiC: Fix typo in nodetitle - s/Prarse/Parse/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parse::RecDescent startup/input error
by amw1 (Friar) on Aug 06, 2004 at 16:32 UTC | |
by JESii (Novice) on Aug 06, 2004 at 17:46 UTC |