I notice that although *.al are right alongside autosplit.ix the
trick AutoLoader::import uses to speed looking for the latter
is not used to find the *.al files - anyone know why?
On NFS mounted file systems at least, all the failed stats/opens are expensive.
(Sadly I am testing this at home where everything is local...)
p5p-msgid: <
199611231954.TAA09921@ni-s.u-net.com>
=cut
AUTOLOAD {
- my $name = "auto/$AUTOLOAD.al";
- # Braces used on the s/// below to preserve $1 et al.
- {$name =~ s#::#/#g}
+ my $name;
+ # Braces used to preserve $1 et al.
+ {
+ my ($pkg,$func) = $AUTOLOAD =~ /(.*)::([^:]+)$/;
+ $pkg =~ s#::#/#g;
+ if (defined($name=$INC{"$pkg.pm"}))
+ {
+ $name =~ s#^(.*)$pkg\.pm$#$1auto/$pkg/$func.al#;
+ $name = undef unless (-r $name);
+ }
+ unless (defined $name)
+ {
+ $name = "auto/$AUTOLOAD.al";
+ $name =~ s#::#/#g;
+ }
+ }
my $save = $@;
eval {require $name};
if ($@) {