Bryan Harris wrote:
> Out of curiosity, why doesn't
>
> <FILE>;
> assign a line to $_, but
Reads a line from the FILE filehandle. Because it is in
'void' context (the result is unused) it behaves as if it
were in scalar context and reads a single line from the
file.
>
> while (<FILE>) {}
>
> does?
This is a special case of the 'while' loop. It is
equivalent to
while (defined($_ = <FILE>)) {
:
}
But there is nowhere else that I can think of that there
is a default destination (left-hand side) of an
expression, although $_ is the default operand of many
built-in Perl functions.
HTH,
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]