Mailing List Archive

AutoLoading and defined &subr
I did not touch autoloading for a year, and remember it being broken
last time I tried. I remember proposing a change to the semantic, that
was kinda praised and quietly ignored.

Now I'm desperately trying to speed up ReadLine (3secs init on
486/66), and found that I may not use AutoLoad with it...

What happens: during init the keybindings are processed, and
the subroutines (quite a number) are checked for existence.

I found that putting stubs does not help:
perl -e "sub sub;print defined &sub"
still prints nothing.

Is there any way to have both autoloading and check?

Ilya
Re: AutoLoading and defined &subr [ In reply to ]
According to Ilya Zakharevich:
> I found that putting stubs does not help:
> perl -e "sub sub;print defined &sub"
> still prints nothing.

Someone else already suggested that

sub foo; defined &sub

should be false, while

sub foo; exists &sub

should be true. Or maybe it was the other way around. But for backwards
compatibility, we can't change the definition of "defined"... can we?
--
Chip Salzenberg, aka <chs@nando.net>
"Hey, it's the Miss Alternate Universe Pageant!"
-- Crow T. Robot, MST3K: "Stranded In Space"