6 AutoLoader - load functions only on demand
13 @ISA = (Exporter, AutoLoader);
17 This module tells its users that functions in the FOOBAR package are to be
18 autoloaded from F<auto/$AUTOLOAD.al>. See L<perlsub/"Autoloading">.
23 my $name = "auto/$AUTOLOAD.al";
27 # The load might just have failed because the filename was too
28 # long for some old SVR3 systems which treat long names as errors.
29 # If we can succesfully truncate a long name then it's worth a go.
30 # There is a slight risk that we could pick up the wrong file here
31 # but autosplit should have warned about that when splitting.
32 if ($name =~ s/(\w{12,})\.al$/substr($1,0,11).".al"/e){
35 elsif ($AUTOLOAD =~ /::DESTROY$/) {
36 eval "sub $AUTOLOAD {}";
48 my ($callclass, $callfile, $callline,$path,$callpack) = caller(0);
49 ($callpack = $callclass) =~ s#::#/#;
50 if (defined($path = $INC{$callpack . '.pm'}))
52 if ($path =~ s#^(.*)$callpack\.pm$#$1auto/$callpack/autosplit.ix# && -e $path)
59 croak "Have not loaded $callpack.pm";