Nathan Wiger wrote:
> I think this is a definite possibility:
>
> $FH = open scalar $myvar;
> print $FH "stuff";
>
> Then the scalar handler would just have to provide the necessary print()
> et al methods to do scalar manipulation. Theoretically this can be done
> modularly, without having to wedge it into the core binary, while still
> being able to get speed benefits.
I fully agree with that last sentence, with the caveat that
[as RFC-186 describes] certain things should be in the
*standard module set* if they are both extremely useful
and extremely dependent on a native implementation for speed.
I argue that IO::Scalar and friends fall into this category.
This gives us:
$FH = open IO::Scalar $myvar;
print $FH "stuff";
I'm weary of proposals like "lets add/extend named operator X".
Perl needs *fewer* special cases, not *more*. I want the
following pairs to ALWAYS be identical, and ALWAYS mean
method invocation:
open THING ARG,...,ARG
THING->open(ARG,...,ARG)
print THING ARG,...,ARG
THING->print(ARG,...,ARG)
And I want the *absence* of an indirect object to have
the well-defined meaning that we are *calling a function*:
print ARGS... # function call of CORE::print()
print $OUT ARGS... # method invocation
$OUT->print(ARGS...) # method invocation
Implementation of CORE::print() then reduces to:
sub CORE::print { $CORE::DEFOUT->print(@_); }
Eryq