Re: RFC 51 (v2) Angle brackets should accept filenames a

[email protected] (Dave Storrs) Fri, 11 Aug 2000 07:43:02 -0700 (PDT)
Newsgroups perl.perl6.language.io
Message-ID <Pine.BSF.4.10.10008110735080.67760-100000@megazone23.bigpanda.com>

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