Graham Barr <[EMAIL PROTECTED]> writes:
> Damian Conway <[EMAIL PROTECTED]> writes:
> > Leon Brocard writes:
> > > =head2 $AUTOLOAD
> > >
> > > While we're at it, it *may* be a good idea to remove the
> > > global $AUTOLOAD variable and instead pass it as the first
> > > parameter of the AUTOLOAD subroutine call. For: general
> > > global drought, the fact that perlsub's argument "because,
> > > er, well, just because, that's why..." is a bit weak.
> > > Against: makes AUTOLOAD more complicated, breaking the
> > > "subroutine parameters end up as @_" paradigm (apparently).
> >
> > This, I really like.
> But it will slow things down. Firstly because it must be added to
> the stack then removed inside the sub.
>
> I don't see any issue keeping $AUTOLOAD as the way the sub name is
> passed.
If we're going with named parameters for subroutines elsewhere can't
we do a bit of magic here? $AUTOLOAD becomes lexically scoped for the
AUTOLOAD subroutine a la named parameters, but is not present in @_.
Hmm... maybe we could have the AUTOLOAD sub refuse to handle a method
by raising an Exception::AUTOLOAD::DECLINE, by analogy with mod_perl
it could also raise an Exception::AUTOLOAD::REFUSED which would
terminate the dispatch process.
Note that this has the advantage of letting old style AUTOLOADs 'just
work' if we just pass any other exceptions up the stack and pass the
return value back as per always.
--
Piers
'063039183598121887134041122600:1917131105:Jaercunrlkso tPh.'=~/^(.{6})*
(.{6})[^:]*:(..)*(..).*:(??{'.{'.$2%$4.'}'})(.)(??{print$5})/x;print"\n"