Doing a while where the conditional is a function of a filehandle iterator (or a couple other iterater-y things) has implicitly done the defined test whether or not there's an assignment to a variable for a while now.
If the condition expression of a "while" statement is based on any of a
group of iterative expression types then it gets some magic treatment.
The affected iterative expression types are "readline", the
"<FILEHANDLE>" input operator, "readdir", "glob", the "<PATTERN>"
globbing operator, and "each". If the condition expression is one of
these expression types, then the value yielded by the iterative operator
will be implicitly assigned to $_. If the condition expression is one of
these expression types or an explicit assignment of one of them to a
scalar, then the condition actually tests for definedness of the
expression's value, not for its regular truth value.
The cake is a lie.
The cake is a lie.
The cake is a lie.