in reply to Re: use warnings => Use of uninitialized value...
in thread use warnings => Use of uninitialized value...

jeanluca:

The problem is that you're using $binrec before you know if it's defined. It appears that the error occurs in your print or if statement.

After reading read, I don't see anything that indicates that SCALAR is changed if nothing can be read due to an error. In that case, SCALAR may still be undefined. In that event, you can change the code to:

read $fh, $binrec, $1; if (defined $binrec) { print "test 1 |$binrec|\n"; . . . } else { print 'test 2: undefined $binrec!\n'; }
--roboticus