The easiest way is to create a subclass of IO::File that would cache the next line for you. So, it would always be a line ahead of where you are. Then, you would just treat that object as your file and add a call to $file->peek whenever you needed to peek at the next line.
The better way, in my humble opinion, is to rewrite your main loop as such:
------
We are the carpenters and bricklayers of the Information Age.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
In reply to Re: unreadline function?
by dragonchild
in thread unreadline function?
by aquarium
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |