At 9:45 -0700 2000.08.12, Nathan Wiger wrote:
>For other stuff, like print(), instead of using the "currently selected
>filehandle", just always have it print to $STDOUT unless something's
>specified. So:
>
> $oldstdout = $STDOUT;
> $STDOUT = $myfileobject;
> print "Hello, world!"; # always prints to $STDOUT, which in
> # this case is a copy of $myfileobject
>
> $STDOUT = $oldstdout;
> print "Hello, world again!";
>
>The rule is easier ("print always goes to $STDOUT, whatever that
>contains") and there's not select() overhead. Everything else should be
>object methods, making stuff clearer still.
And it is also a pain in the butt.
select *LOG;
do_stuff();
sub do_stuff {
print "this stuff goes somewhere\n";
print STDOUT "we printed stuff somewhere\n";
}
You're saying, I suppose, that we should just pass the *LOG filehandle to
do_stuff(). But I'd rather not.
>In any case, that's the idea. I'm not necessarily heartset on it, but I
>do think it makes things simpler and faster. The "currently selected
>filehandle" is something every beginner I've talked to has a ton of
>trouble comprehending.
Hm. It is something they don't even have to know about. Don't tell them
about select(), and they don't have to use it. Same as now. Let's not
cripple the language for the sake of beginners. If we have to be more
verbose in Perl 6 than in Perl 5, many people are going to stick with Perl
5. Implicit arguments and behaviors are important.
Autoflush is another story. Everything, from autoflush to input record
separator to output record separator and onward, must be per-filehandle, I
think. I'd rather we didn't have to resort to a method to do it, though.
Object-oriented syntax should be optional, not required, for basic
functionality in the core language.
Thanks,
--
Chris Nandor | [EMAIL PROTECTED] | http://pudge.net/
Andover.Net | [EMAIL PROTECTED] | http://slashcode.com/