develooper Front page | perl.perl5.porters | Postings from March 2000


Thread Previous | Thread Next
Benjamin Stuhl
March 20, 2000 13:34
Message ID:
>From: "M.J.T. Guy" <>
>Date: Mon, 20 Mar 2000 10:15:58 +0000
>Apart from the dialogue between Ilya and myself, noone has commented
>on my AUTOLOADREF proposal.    Is everyone
>    rendered speechless by the brilliance of the proposal?
>    rendered speechless by the stupidity of the proposal?
>    unable to see beyond the 5.6.0 event horizon?
>    gone off to work on Python?
>    still unconscious after St Patrick's Day?

Busy debating adding core hooks/source filters/embedded SQL? :)

>I'd like to hear comments from some others before I do any more on this.
>Ilya's and my ideas seem to be very similar, with two relatively minor
>(as I see it) differences:
>i)   Should there be one subroutine, with flags, (as I propose) or
>      different subroutines for the different cases (compile time versus
>      run time etc) (as Ilya proposes)?
>ii)  Should the subroutine have a visible name, e.g. AUTOLOADREF (as I
>      propose) or some "hidden" name containing unusual characters as
>      Ilya proposes?
>Opinions on these choices would be welcome.
>And of course, there's an opportunity for a good ding-dong battle on the
>choice of name.
>Mike Guy

I think I like the user-visible name form better, mainly because it would 
allow for nifty tricks like autoloading part of your autoloader:

    ... blah ...
    if ($I_need_to_load_from_the_ultimate_zipped_library) {
        *AUTOLOAD2 = load_ziploader();
        goto &AUTOLOAD2;
    ... blah ...

Not that this can't be done with hidden names, it just requires some playing 
around with code refs:

use autoload 'prototype' => \&get_proto, 'body' => $loader_heavy;

sub get_proto {
    our $loader_heavy = load_heavy_loader; # we'll need it
    ... blah ...

As for a name, I suggest AUTOLOAD2, since this would be version 2 of 

-- BKS
Get Your Private, Free Email at

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About