I think your immediate problem can be resolved by "rewinding" the filehandle before reading (it's positioned at the end of the file when you've written $page to it).
Doing seek TMP,0,0; before the while (<TMP>) line should take care of that.
See seek.
In reply to Re: Reading a line from a Temporary File
by Joost
in thread Reading a line from a Temporary File
by dReKurCe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |