in reply to Filehandle Print
You're just being tripped up by buffering. The filehandle is being written to, but due to buffering nothing is getting flushed right away. If you waited long enough (sleep 30?) eventually the buffer would fill enough to be flushed to the file.
When you close a filehandle, the buffer is flushed. But this script will never automatically close the filehandle because it never exists from the while loop, and because the only way "out" of the script is to hit ctrl-c, which halts it before the file can be properly flushed/closed.
I hate to use $|, but you will find that setting $| will probably eliminate the behavior. I would much prefer simply improving the design, rather than using a band-aid.
Dave
|
|---|