On Fri, May 04, 2001 at 07:02:14PM -0700, Nathan Wiger wrote:
> > While perhaps inconsistent, I'd really rather it did #2. Here's the
> > basic argument... compare how often you dup a filehandle with how
> > often you read from one. Duping is swamped by several orders of
> > magnitude. Dup with $fh = $STDIN.copy; (or whatever). $line =
> > $STDIN.next should still work normally.
>
> You know, I hear what you're saying, but it really makes the little hairs on
> my neck stand up. Just imaging trying to teach this:
>
> $a = $b; # assignment or readline?
Well, overloading and tying can already do things like this, but
that's a weak argument at best.
I dunno, I think its natural enough that it won't seem jaring. And
after the nth time of having to type "while($line = $file.next) {"
you'll be wishing for it. Maybe other people use $_ more than I do.
I rarely use it.
Of course, if overloading is implemented well, as I expect it to be,
there's no reason you couldn't just have a special filehandle class
that redefines the copy constructor.
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
List context isn't dangerous. Misquoting Gibson is dangerous.