Greetings all, Right off the bat I would think of using seek and the $. special variable (current line number: see Perl Special Variables Quick Reference) to keep track of where you have been and where you want to print to.
-InjunJoel
Update!
Though it seemed simple at first, upon actually attempting to code something using seek and $. I agree with Animator. What I got was 40+ lines of buggy code before I finally stopped. Disregard my posting above.
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo