Re: RFC 215 (v1) More defaulting to C<$_>.

[email protected] (Nathan Wiger)
Newsgroups perl.perl6.announce.rfc,perl.perl6.language
Message-ID <[email protected]>
> An inconsistency between "C<print>" and "<>" bugs me:  "C<print;>" means
> "C<print $_;>" so it seems like "<>" should mean "C<$_ = > <>".
> I can't yet think of code that this extension would break.
> 
> Would this have an advantage in making the
> 
>  while( <> ) {
>  }
> 
> syntax less magical?

You should probably check out RFC 129. I wrote it to suggest that <>
default to $DEFIN, the new default input handle, instead of iterating
through @ARGV. I think this might implicitly solve your problem because
<> would then mean "$_ = <$DEFIN>", which is I think what you're after. 

Implicit in all this is that you'd have to do something special to get
the magic effects of <> currently. Maybe explicitly referencing $ARGV
(the polymorphic filehandle, not filename*) is enough?

   while (<$ARGV>) { }

Hmmmm. But then you've still got a nasty inconsistency, just rather than
being <> it's <$ARGV>.

-Nate

* filehandles and filenames are both scalars in Perl 6, supposedly. This
isn't a big problem for ARGV vs. $ARGV after all, see here:

http://www.mail-archive.com/[email protected]/msg03279.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.