> The AUTOGLOB subroutine should expect to take two parameters, the invocant,
> and a second parameter specifying what type of item is being AUTOGLOBbed,
> followed by - in the case of a sub - the sub's arguments.  We suggest that
> the second parameter should be a scalar value - 'scalar' for an AUTOGLOBbed
> scalar, 'array' for an AUTOGLOBbed array, and so on.  

This is an interesting idea, but I don't think that a single AUTOGLOB,
that has to internally decide what to do based on a string match of one
of its arguments, is the best way to go for this. I think TIE has it
right:

   AUTOSCALAR
   AUTOARRAY
   AUTOHASH
   AUTOLOAD

This actually has an advantage - in inheritance, you can polymorphically
inherit some or all of the AUTO* routines without having to rewrite the
whole sub.

> The $AUTOLOAD variable should be renamed to $AUTOGLOB
> (with $AUTOLOAD as a deprecated synonym as above).

As RFC 8 hints at, $AUTOLOAD should die completely. Make the name of the
variable or sub an argument. This has another benefit in that the name
of the variable is going to be passed into TIE* as well in Perl 6. Very
nice symmetry.

-Nate

Reply via email to