in reply to readline() on closed filehandle GEN1

You never check whether your

open ($filehandle, "<$TMP_DIR/$$");

is successfull.

For debugging use

my $tempfile= "$TMP_DIR/$$"; open ($filehandle, "<$tempfile") or die "Couldn't read tempfile '$tempfile': $!";

Personally, I would look at using File::Temp instead for tempfiles.

Replies are listed 'Best First'.
Re^2: readline() on closed filehandle GEN1
by Arun Kumar (Novice) on Jul 03, 2013 at 19:44 UTC

    thanks for the quick reply Corion. One thing which I wonder about this file is that it works for all other pages expect one. Still I have debugged the way you told. Still getting the same error.