On Fri, Jul 07, 2000 at 03:19:29PM +0100, Graham Barr wrote:
> I have not looked at the code, but I assume it works by Class::WhiteHole 
> defining an AUTOLOAD sub which just dies. 

Pretty much.  You have to do a few tricks for DESTROY and to make sure
the right error message shows up (all of which I forgot to do in 0.01
*sigh*)

> If so then I would consider a
> patch to AutoLoader.pm which allows
> 
>   no AutoLoader;

That was along the lines of my first thought, too.  Problem is when
used naively, no AutoLoader could severely screw things up.  Consider:

package Foo;

use AutoLoader qw(AUTOLOAD);
@ISA = qw(AutoLoader);

sub public_bar {
    my($self) = shift;
    return $self->_autoloaded_private_method();
}
__END__
sub _autoloaded_private_method {
    return 'whatever';
}


# Meanwhile, in a nearby file
package Bar;

use base qw(Foo);
no AutoLoader;

# Ooops, public_bar() can't autoload _autoloaded_private_method()
# because we blocked reaching AutoLoader from Bar.
Bar->public_bar;


Blocking inheritance has to be done selectively and carefully.


-- 

Michael G Schwern      http://www.pobox.com/~schwern/      [EMAIL PROTECTED]
<GuRuThuG> make a channel called Perl, and infest it with joking and
fun....it doesnt make alot of sense.

Reply via email to