in reply to Re: Re^2: To Kill a Meme: while(defined($line = <>))
in thread To Kill a Meme: while(defined($line = <>))

You missed the real point. This has nothing to do with whether Perl "automatically" checks undef. The real point here is that, under a normal situation without set $/, you don't get a real empty string or a "0" back, so those posibilities are eliminated, and this leaves undef the only condition that may evaluate $line to false, thus the use of "defined" is not neccessary here.

But it is possible to get a false value back without changing $/, if the last "line" consists of a single 0 with no terminating newline. And you can see the effect of losing the defined check if you add something else to the conditional (perl only supplies the defined test when the condition is a plain read operator or read operator with assignment (control D to end input without final newline):

:~$ cat > OOPS 3 2 1 0^D :~$ perl -e '$foo = 42; while($foo and $_ = <>){print}' OOPS 3 2 1 :~$ :~$ perl -e '$foo = 42; while($foo and defined($_ = <>)){print}' OOPS 3 2 1 0:~$

So the possibility of losing data without defined exists regardless of what value is assigned to $/.