in reply to Tracking Lines Printed to a FileHandle
You either have to track that explicitly, with some sort of counter, possibly in your printing loop, or you need a little smoke and mirrors magic.
If you are a proponent of magic, you can tie your filehandle to a class that keeps track of the number of lines printed for you. You could then query the filehandle object to determine if the max number of lines has been reached, or if it's nearing, etc.
See tie, and perltie for details on tieing filehandles. The details are a little obscure at first, but once you get the hang of it you can create some interesting spells.
Dave
|
|---|