in reply to Reading a line from a Temporary File

If the whole content of the page is already in $page, I can't see much use for using a temporary file; you can just run the regex against $page directly.

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.

Replies are listed 'Best First'.
Re^2: Reading a line from a Temporary File
by dReKurCe (Scribe) on Jul 31, 2005 at 20:38 UTC
    Amazing solution! Thank you!