There's more than one way to do things | |
PerlMonks |
Re: redo entire loopby zek152 (Pilgrim) |
on Aug 13, 2010 at 15:42 UTC ( [id://854932]=note: print w/replies, xml ) | Need Help?? |
I believe I understand your question. (disclaimer: this in no way is an admission of liability if I do not, in fact, understand your question) What I think you should do (for simplicity's sake) is run 2 passes on the file, like so:
Notes about the code: It's not particularly efficient. You might have to go through the file twice (worst case). However to me the advantage is that it is simple. You look for the value. if you find it then stop looking and start over modifying the file. If you dont find it then you are already done. Hope this helps. Final note. This code has not been tested and it will take a little work to address your problem. It is intended as a framework for you to use.
In Section
Seekers of Perl Wisdom
|
|