in reply to Re^7: Passing a file handle to a sub. I still don't get it.
in thread Passing a file handle to a sub. I still don't get it.

Don't worry about false lines. That is only possible when he mucks with $/ or the input line is broken with ^D which is possibly entered to leave the while.
  • Comment on Re^8: Passing a file handle to a sub. I still don't get it.

Replies are listed 'Best First'.
Re^9: Passing a file handle to a sub. I still don't get it.
by ysth (Canon) on Jun 12, 2005 at 04:55 UTC
    ^D should yield an eof, which should result in readline returning undef, not "", so the defined() wouldn't make a difference.

    A false line happens without mucking with $/ when you have a 0 at the end of a file, not followed by a newline.