summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/AutoLoader.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/AutoLoader.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/AutoLoader.pm30
1 files changed, 27 insertions, 3 deletions
diff --git a/Master/tlpkg/tlperl/lib/AutoLoader.pm b/Master/tlpkg/tlperl/lib/AutoLoader.pm
index 8dab836ab30..955f852cbf3 100644
--- a/Master/tlpkg/tlperl/lib/AutoLoader.pm
+++ b/Master/tlpkg/tlperl/lib/AutoLoader.pm
@@ -15,11 +15,18 @@ BEGIN {
$is_epoc = $^O eq 'epoc';
$is_vms = $^O eq 'VMS';
$is_macos = $^O eq 'MacOS';
- $VERSION = '5.72';
+ $VERSION = '5.73';
}
AUTOLOAD {
my $sub = $AUTOLOAD;
+ autoload_sub($sub);
+ goto &$sub;
+}
+
+sub autoload_sub {
+ my $sub = shift;
+
my $filename = AutoLoader::find_filename( $sub );
my $save = $@;
@@ -48,7 +55,8 @@ AUTOLOAD {
}
}
$@ = $save;
- goto &$sub;
+
+ return 1;
}
sub find_filename {
@@ -335,6 +343,21 @@ create the individual files. L<ExtUtils::MakeMaker> will invoke
B<AutoSplit> automatically if B<AutoLoader> is used in a module source
file.
+=head2 Forcing AutoLoader to Load a Function
+
+Sometimes, it can be necessary or useful to make sure that a certain
+function is fully loaded by AutoLoader. This is the case, for example,
+when you need to wrap a function to inject debugging code. It is also
+helpful to force early loading of code before forking to make use of
+copy-on-write as much as possible.
+
+Starting with AutoLoader 5.73, you can call the
+C<AutoLoader::autoload_sub> function with the fully-qualified name of
+the function to load from its F<.al> file. The behaviour is exactly
+the same as if you called the function, triggering the regular
+C<AUTOLOAD> mechanism, but it does not actually execute the
+autoloaded function.
+
=head1 CAVEATS
AutoLoaders prior to Perl 5.002 had a slightly different interface. Any
@@ -376,7 +399,8 @@ can benefit from bug fixes.
This package has the same copyright and license as the perl core:
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2011, 2012
by Larry Wall and others
All rights reserved.