in reply to Using null filehandle

One thing I notice is that you're using "while ($line = <>){" which will stop as soon as a line comes through that's "false" (ie, empty, or a literal "0"). You might try using "while (defined($line = <>)){" instead.

Replies are listed 'Best First'.
Re^2: Using null filehandle
by Somni (Friar) on Jun 09, 2004 at 07:36 UTC

    Ever since perl 5.004 the code:

    while ($line = <FH>)

    has an implicit defined check, so that it's actually:

    while (defined($line = <FH>))

    This was because, prior to this, that code would emit a warning; it was a common enough desire that perl was simply modified to accept it as intended.

    Also, while it is possible for a line to have "0" on it, with no newline, it isn't possible for <FH> to return "" unless it's tied.