Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Perl Parsing Based on Supplied Precedenceby grizzley (Chaplain) |
on Nov 07, 2012 at 10:01 UTC ( [id://1002649]=note: print w/replies, xml ) | Need Help?? |
You can simplify code a little bit by moving $node declaration to the inner loop (and I replaced condition $3 with match result):
and optimize the code by moving $input=~s/\s//g outside parse sub. It is enough to do this once in while loop after reading input data.
In Section
Cool Uses for Perl
|
|