Front page | perl.perl5.porters |
Postings from March 2000
From: Ilya Zakharevich
March 15, 2000 10:55
Message ID: 200003151855.NAA17865@monk.mps.ohio-state.edu
M.J.T. Guy writes:
> All these problems have the same root cause - the fact that you can't
> load a subroutine without also calling it.
Nope, they have two roots: this one, and that you cannot run some
action when an undefined subroutine is seen at *compile* time.
See my proposal on 'use autoload'.
> So I propose a new reserved subroutine AUTOLOADREF. (The name is
> deliberately ugly to encourage people to make better suggestions.
> Also see below for an alternative to a new reserved word.)
No new magic names, please! In my proposal what you want would be
use autoload body => \&AUTOLOADREF;
But there is an additional (and separate!) callback to be called at
use autoload proto => whatever;
which should return the prototype (but may have an arbitrary side
effect like defining the subroutine).