DynaLoader currently uses Autoloader. This was an optimization going
back to perl 5.000 in 1994. However, this implementation detail leaks in
a rather troublesome way.
DynaLoader is used by subclassing it. Because of this, when you call
some undefined method on an instance of any class that derives from
DynaLoader (directly or indirectly) you do not get this error message:
Can't locate object method "undefined_method" via package "Foo"
But this rather cryptic error:
Can't locate auto/Foo/undefined_m.al in @INC (@INC contains:
/etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0
/usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10
/usr/local/lib/site_perl .)
This is totally incomprehensible for anyone who isn't familiar with
what's going on. It was rather a premature optimization anyway if you
ask me, on my machine it's just 66 non-empty lines of code that are
being autoloaded.
Therefore, I think AutoLoader should be removed from DynaLoader.
$VERSION = '1.12';
}
-require AutoLoader;
-*AUTOLOAD = \&AutoLoader::AUTOLOAD;
-
use Config;
# enable debug/trace messages from DynaLoader perl code
&$xs(@args);
}
-
-#sub _check_file { # private utility to handle dl_expandspec vs -f tests
-# my($file) = @_;
-# return $file if (!$do_expand && -f $file); # the common case
-# return $file if ( $do_expand && ($file=dl_expandspec($file)));
-# return undef;
-#}
-
-
-# Let autosplit and the autoloader deal with these functions:
-__END__
-
-
sub dl_findfile {
# Read ext/DynaLoader/DynaLoader.doc for detailed information.
# This function does not automatically consider the architecture
return undef;
}
+__END__
+
=head1 NAME
DynaLoader - Dynamically load C libraries into Perl code