|
|
| go ahead... be a heretic | |
| PerlMonks |
Re: Trying to do multiple while loops on the same input fileby thezip (Vicar) |
| on Jun 01, 2011 at 16:35 UTC ( #907662=note: print w/ replies, xml ) | Need Help?? |
|
This doesn't answer to your original problem of reading a file with multiple while loops, but it does present another WTDI that, to me, seems much more natural. Since your file is really small, read it in its entirety into and array of lines, a la:
Now you can process the content of you file to your heart's content by simply maintaining the relevant indices for the lines you want to be dealing with, and iterating via "for" loops. You can do this as many times as you want without having to worry about iterating via <>... Updated: Added blurb re: for-loop iteration What can be asserted without proof can be dismissed without proof. - Christopher Hitchens
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||