On 9 Aug 2000, Chaim Frenkel wrote:
> >>>>> "JE" == Jon Ericson <[EMAIL PROTECTED]> writes:
>
> JE> Chaim Frenkel wrote:
> >> What does
> >>
> >> $foo = <"filename">; # 1
> >> $bar = <"another">;
> >> $gaz = <"filename">; # 2
>
> >> Does #2 get the second line or the first?
>
> JE> $gaz contains the second line. Otherwise this:
>
> JE> while (<'filename'>){print;};
Actually, this brings up something I've always wondered about.
Compare the following:
$_ = <FILE>; # Explicit assignment to $_, OK
while (<FILE>){} # Automagic assignment to $_ because in while, OK
<FILE>; # WHOOPS! Line read, but not assigned anywhere.
It would seem intuitive to me that "<FILE>" means "$_ = <FILE>". Why was
it not done this way originally? (I assume there is some reason, I just
don't know what it is.)
Dave