/usr/share/perl5
NameSizeModeActions
App/-0755rm
Archive/-0755rm
Attribute/-0755rm
autodie/-0755rm
B/-0755rm
Carp/-0755rm
CGI/-0755rm
Class/-0755rm
Config/-0755rm
CPAN/-0755rm
CPANPLUS/-0755rm
DBIx/-0755rm
DBM_Filter/-0755rm
Devel/-0755rm
Digest/-0755rm
Encode/-0755rm
encoding/-0755rm
Exporter/-0755rm
ExtUtils/-0755rm
File/-0755rm
Filter/-0755rm
Getopt/-0755rm
HTML/-0755rm
I18N/-0755rm
IO/-0755rm
IPC/-0755rm
JSON/-0755rm
Locale/-0755rm
Log/-0755rm
Math/-0755rm
Memoize/-0755rm
Module/-0755rm
Net/-0755rm
Object/-0755rm
overload/-0755rm
Package/-0755rm
Params/-0755rm
Parse/-0755rm
PerlIO/-0755rm
Pod/-0755rm
pod/-0755rm
Search/-0755rm
TAP/-0755rm
Term/-0755rm
Test/-0755rm
Test2/-0755rm
Text/-0755rm
Thread/-0755rm
Tie/-0755rm
Time/-0755rm
Unicode/-0755rm
unicore/-0755rm
URI/-0755rm
User/-0755rm
vendor_perl/-0755rm
version/-0755rm
warnings/-0755rm
abbrev.pl8380644editdlrm
AnyDBM_File.pm25940644editdlrm
assert.pl12980644editdlrm
attributes.pm148770644editdlrm
autodie.pm117630644editdlrm
AutoLoader.pm149970644editdlrm
AutoSplit.pm196370644editdlrm
autouse.pm42380644editdlrm
base.pm69860644editdlrm
Benchmark.pm285300644editdlrm
bigfloat.pl73680644editdlrm
bigint.pl89590644editdlrm
bigint.pm178520644editdlrm
bignum.pm186730644editdlrm
bigrat.pl44760644editdlrm
bigrat.pm144420644editdlrm
blib.pm21060644editdlrm
bytes.pm23840644editdlrm
bytes_heavy.pl7580644editdlrm
cacheout.pl11220644editdlrm
Carp.pm76110644editdlrm
CGI.pm2614780644editdlrm
charnames.pm156700644editdlrm
complete.pl31910644editdlrm
constant.pm125280644editdlrm
CORE.pod15690644editdlrm
CPAN.pm1309070644editdlrm
CPANPLUS.pm72690644editdlrm
ctime.pl19930644editdlrm
DB.pm192020644editdlrm
DBM_Filter.pm144150644editdlrm
diagnostics.pm173800644editdlrm
Digest.pm104120644editdlrm
DirHandle.pm19370644editdlrm
dotsh.pl21750644editdlrm
Dumpvalue.pm168990644editdlrm
dumpvar.pl152750644editdlrm
English.pm44880644editdlrm
Env.pm51700644editdlrm
exceptions.pl17360644editdlrm
Expect.pm547250644editdlrm
Expect.pod437350644editdlrm
Exporter.pm185950644editdlrm
fastcwd.pl10190644editdlrm
Fatal.pm409660644editdlrm
feature.pm50920644editdlrm
fields.pm95070644editdlrm
FileCache.pm55700644editdlrm
FileHandle.pm67780644editdlrm
filetest.pm40030644editdlrm
find.pl11850644editdlrm
FindBin.pm56580644editdlrm
finddepth.pl11300644editdlrm
flush.pl6420644editdlrm
getcwd.pl14270644editdlrm
getopt.pl13220644editdlrm
getopts.pl14060644editdlrm
hostname.pl7270644editdlrm
if.pm11660644editdlrm
importenv.pl2830644editdlrm
integer.pm32660644editdlrm
less.pm30840644editdlrm
locale.pm8200644editdlrm
look.pl12550644editdlrm
Memoize.pm352950644editdlrm
newgetopt.pl22130644editdlrm
NEXT.pm184810644editdlrm
ok.pm9670444editdlrm
open.pm77400644editdlrm
open2.pl1850644editdlrm
open3.pl1850644editdlrm
overload.pm480500644editdlrm
overloading.pm18010644editdlrm
parent.pm29980644editdlrm
perl5db.pl3176820644editdlrm
PerlIO.pm111220644editdlrm
pwd.pl14780644editdlrm
Safe.pm243260644editdlrm
SelectSaver.pm10760644editdlrm
SelfLoader.pm173410644editdlrm
Shell.pm86850644editdlrm
shellwords.pl2760644editdlrm
sigtrap.pm76110644editdlrm
sort.pm60930644editdlrm
stat.pl5900644editdlrm
strict.pm37160644editdlrm
subs.pm8420644editdlrm
Switch.pm285080644editdlrm
Symbol.pm47940644editdlrm
syslog.pl48060644editdlrm
tainted.pl1640644editdlrm
termcap.pl41140644editdlrm
Test.pm288000644editdlrm
Test2.pm63930444editdlrm
Thread.pm82850644editdlrm
timelocal.pl6900644editdlrm
UNIVERSAL.pm65360644editdlrm
utf8.pm69180644editdlrm
utf8_heavy.pl80010644editdlrm
validate.pl37310644editdlrm
vars.pm23580644editdlrm
version.pm10370644editdlrm
version.pod123150644editdlrm
vmsish.pm43280644editdlrm
warnings.pm161330644editdlrm
Edit: /usr/share/perl5/AutoLoader.pm (14997B)
package AutoLoader; use strict; use 5.006_001; our($VERSION, $AUTOLOAD); my $is_dosish; my $is_epoc; my $is_vms; my $is_macos; BEGIN { $is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'NetWare'; $is_epoc = $^O eq 'epoc'; $is_vms = $^O eq 'VMS'; $is_macos = $^O eq 'MacOS'; $VERSION = '5.68'; } AUTOLOAD { my $sub = $AUTOLOAD; my $filename = AutoLoader::find_filename( $sub ); my $save = $@; local $!; # Do not munge the value. eval { local $SIG{__DIE__}; require $filename }; if ($@) { if (substr($sub,-9) eq '::DESTROY') { no strict 'refs'; *$sub = sub {}; $@ = undef; } elsif ($@ =~ /^Can't locate/) { # The load might just have failed because the filename was too # long for some old SVR3 systems which treat long names as errors. # If we can successfully truncate a long name then it's worth a go. # There is a slight risk that we could pick up the wrong file here # but autosplit should have warned about that when splitting. if ($filename =~ s/(\w{12,})\.al$/substr($1,0,11).".al"/e){ eval { local $SIG{__DIE__}; require $filename }; } } if ($@){ $@ =~ s/ at .*\n//; my $error = $@; require Carp; Carp::croak($error); } } $@ = $save; goto &$sub; } sub find_filename { my $sub = shift; my $filename; # Braces used to preserve $1 et al. { # Try to find the autoloaded file from the package-qualified # name of the sub. e.g., if the sub needed is # Getopt::Long::GetOptions(), then $INC{Getopt/Long.pm} is # something like '/usr/lib/perl5/Getopt/Long.pm', and the # autoload file is '/usr/lib/perl5/auto/Getopt/Long/GetOptions.al'. # # However, if @INC is a relative path, this might not work. If, # for example, @INC = ('lib'), then $INC{Getopt/Long.pm} is # 'lib/Getopt/Long.pm', and we want to require # 'auto/Getopt/Long/GetOptions.al' (without the leading 'lib'). # In this case, we simple prepend the 'auto/' and let the # C take care of the searching for us. my ($pkg,$func) = ($sub =~ /(.*)::([^:]+)$/); $pkg =~ s#::#/#g; if (defined($filename = $INC{"$pkg.pm"})) { if ($is_macos) { $pkg =~ tr#/#:#; $filename = undef unless $filename =~ s#^(.*)$pkg\.pm\z#$1auto:$pkg:$func.al#s; } else { $filename = undef unless $filename =~ s#^(.*)$pkg\.pm\z#$1auto/$pkg/$func.al#s; } # if the file exists, then make sure that it is a # a fully anchored path (i.e either '/usr/lib/auto/foo/bar.al', # or './lib/auto/foo/bar.al'. This avoids C searching # (and failing) to find the 'lib/auto/foo/bar.al' because it # looked for 'lib/lib/auto/foo/bar.al', given @INC = ('lib'). if (defined $filename and -r $filename) { unless ($filename =~ m|^/|s) { if ($is_dosish) { unless ($filename =~ m{^([a-z]:)?[\\/]}is) { if ($^O ne 'NetWare') { $filename = "./$filename"; } else { $filename = "$filename"; } } } elsif ($is_epoc) { unless ($filename =~ m{^([a-z?]:)?[\\/]}is) { $filename = "./$filename"; } } elsif ($is_vms) { # XXX todo by VMSmiths $filename = "./$filename"; } elsif (!$is_macos) { $filename = "./$filename"; } } } else { $filename = undef; } } unless (defined $filename) { # let C do the searching $filename = "auto/$sub.al"; $filename =~ s#::#/#g; } } return $filename; } sub import { my $pkg = shift; my $callpkg = caller; # # Export symbols, but not by accident of inheritance. # if ($pkg eq 'AutoLoader') { if ( @_ and $_[0] =~ /^&?AUTOLOAD$/ ) { no strict 'refs'; *{ $callpkg . '::AUTOLOAD' } = \&AUTOLOAD; } } # # Try to find the autosplit index file. Eg., if the call package # is POSIX, then $INC{POSIX.pm} is something like # '/usr/local/lib/perl5/POSIX.pm', and the autosplit index file is in # '/usr/local/lib/perl5/auto/POSIX/autosplit.ix', so we require that. # # However, if @INC is a relative path, this might not work. If, # for example, @INC = ('lib'), then # $INC{POSIX.pm} is 'lib/POSIX.pm', and we want to require # 'auto/POSIX/autosplit.ix' (without the leading 'lib'). # (my $calldir = $callpkg) =~ s#::#/#g; my $path = $INC{$calldir . '.pm'}; if (defined($path)) { # Try absolute path name, but only eval it if the # transformation from module path to autosplit.ix path # succeeded! my $replaced_okay; if ($is_macos) { (my $malldir = $calldir) =~ tr#/#:#; $replaced_okay = ($path =~ s#^(.*)$malldir\.pm\z#$1auto:$malldir:autosplit.ix#s); } else { $replaced_okay = ($path =~ s#^(.*)$calldir\.pm\z#$1auto/$calldir/autosplit.ix#); } eval { require $path; } if $replaced_okay; # If that failed, try relative path with normal @INC searching. if (!$replaced_okay or $@) { $path ="auto/$calldir/autosplit.ix"; eval { require $path; }; } if ($@) { my $error = $@; require Carp; Carp::carp($error); } } } sub unimport { my $callpkg = caller; no strict 'refs'; for my $exported (qw( AUTOLOAD )) { my $symname = $callpkg . '::' . $exported; undef *{ $symname } if \&{ $symname } == \&{ $exported }; *{ $symname } = \&{ $symname }; } } 1; __END__ =head1 NAME AutoLoader - load subroutines only on demand =head1 SYNOPSIS package Foo; use AutoLoader 'AUTOLOAD'; # import the default AUTOLOAD subroutine package Bar; use AutoLoader; # don't import AUTOLOAD, define our own sub AUTOLOAD { ... $AutoLoader::AUTOLOAD = "..."; goto &AutoLoader::AUTOLOAD; } =head1 DESCRIPTION The B module works with the B module and the C<__END__> token to defer the loading of some subroutines until they are used rather than loading them all at once. To use B, the author of a module has to place the definitions of subroutines to be autoloaded after an C<__END__> token. (See L.) The B module can then be run manually to extract the definitions into individual files F. B implements an AUTOLOAD subroutine. When an undefined subroutine in is called in a client module of B, B's AUTOLOAD subroutine attempts to locate the subroutine in a file with a name related to the location of the file from which the client module was read. As an example, if F is located in F, B will look for perl subroutines B in F, where the C<.al> file has the same name as the subroutine, sans package. If such a file exists, AUTOLOAD will read and evaluate it, thus (presumably) defining the needed subroutine. AUTOLOAD will then C the newly defined subroutine. Once this process completes for a given function, it is defined, so future calls to the subroutine will bypass the AUTOLOAD mechanism. =head2 Subroutine Stubs In order for object method lookup and/or prototype checking to operate correctly even when methods have not yet been defined it is necessary to "forward declare" each subroutine (as in C). See L. Such forward declaration creates "subroutine stubs", which are place holders with no code. The AutoSplit and B modules automate the creation of forward declarations. The AutoSplit module creates an 'index' file containing forward declarations of all the AutoSplit subroutines. When the AutoLoader module is 'use'd it loads these declarations into its callers package. Because of this mechanism it is important that B is always Cd and not Cd. =head2 Using B's AUTOLOAD Subroutine In order to use B's AUTOLOAD subroutine you I explicitly import it: use AutoLoader 'AUTOLOAD'; =head2 Overriding B's AUTOLOAD Subroutine Some modules, mainly extensions, provide their own AUTOLOAD subroutines. They typically need to check for some special cases (such as constants) and then fallback to B's AUTOLOAD for the rest. Such modules should I import B's AUTOLOAD subroutine. Instead, they should define their own AUTOLOAD subroutines along these lines: use AutoLoader; use Carp; sub AUTOLOAD { my $sub = $AUTOLOAD; (my $constname = $sub) =~ s/.*:://; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { if ($! =~ /Invalid/ || $!{EINVAL}) { $AutoLoader::AUTOLOAD = $sub; goto &AutoLoader::AUTOLOAD; } else { croak "Your vendor has not defined constant $constname"; } } *$sub = sub { $val }; # same as: eval "sub $sub { $val }"; goto &$sub; } If any module's own AUTOLOAD subroutine has no need to fallback to the AutoLoader's AUTOLOAD subroutine (because it doesn't have any AutoSplit subroutines), then that module should not use B at all. =head2 Package Lexicals Package lexicals declared with C in the main block of a package using B will not be visible to auto-loaded subroutines, due to the fact that the given scope ends at the C<__END__> marker. A module using such variables as package globals will not work properly under the B. The C pragma (see L) may be used in such situations as an alternative to explicitly qualifying all globals with the package namespace. Variables pre-declared with this pragma will be visible to any autoloaded routines (but will not be invisible outside the package, unfortunately). =head2 Not Using AutoLoader You can stop using AutoLoader by simply no AutoLoader; =head2 B vs. B The B is similar in purpose to B: both delay the loading of subroutines. B uses the C<__DATA__> marker rather than C<__END__>. While this avoids the use of a hierarchy of disk files and the associated open/close for each routine loaded, B suffers a startup speed disadvantage in the one-time parsing of the lines after C<__DATA__>, after which routines are cached. B can also handle multiple packages in a file. B only reads code as it is requested, and in many cases should be faster, but requires a mechanism like B be used to create the individual files. L will invoke B automatically if B is used in a module source file. =head1 CAVEATS AutoLoaders prior to Perl 5.002 had a slightly different interface. Any old modules which use B should be changed to the new calling style. Typically this just means changing a require to a use, adding the explicit C<'AUTOLOAD'> import if needed, and removing B from C<@ISA>. On systems with restrictions on file name length, the file corresponding to a subroutine may have a shorter name that the routine itself. This can lead to conflicting file names. The I package warns of these potential conflicts when used to split a module. AutoLoader may fail to find the autosplit files (or even find the wrong ones) in cases where C<@INC> contains relative paths, B the program does C. =head1 SEE ALSO L - an autoloader that doesn't use external files. =head1 AUTHOR C is maintained by the perl5-porters. Please direct any questions to the canonical mailing list. Anything that is applicable to the CPAN release can be sent to its maintainer, though. Author and Maintainer: The Perl5-Porters Maintainer of the CPAN release: Steffen Mueller =head1 COPYRIGHT AND LICENSE This package has been part of the perl core since the first release of perl5. It has been released separately to CPAN so older installations 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 by Larry Wall and others All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" which comes with this Kit. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this Kit, in the file named "Artistic". If not, I'll be glad to provide one. You should also have received a copy of the GNU General Public License along with this program in the file named "Copying". If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA or visit their web page on the internet at http://www.gnu.org/copyleft/gpl.html. For those of you that choose to use the GNU General Public License, my interpretation of the GNU General Public License is that no Perl script falls under the terms of the GPL unless you explicitly put said script under the terms of the GPL yourself. Furthermore, any object code linked with perl does not automatically fall under the terms of the GPL, provided such object code only adds definitions of subroutines and variables, and does not otherwise impair the resulting interpreter from executing any standard Perl script. I consider linking in C subroutines in this manner to be the moral equivalent of defining subroutines in the Perl language itself. You may sell such an object file as proprietary provided that you provide or offer to provide the Perl source, as specified by the GNU General Public License. (This is merely an alternate way of specifying input to the program.) You may also sell a binary produced by the dumping of a running Perl script that belongs to you, provided that you provide or offer to provide the Perl source as specified by the GPL. (The fact that a Perl interpreter and your code are in the same binary file is, in this case, a form of mere aggregation.) This is my interpretation of the GPL. If you still have concerns or difficulties understanding my intent, feel free to contact me. Of course, the Artistic License spells all this out for your protection, so you may prefer to use that. =cut