exiftool-vendored.exe 12.82.0 → 12.82.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/README.md +6 -0
  2. package/bin/exiftool.exe +0 -0
  3. package/bin/exiftool_files/Licenses_Strawberry_Perl.zip +0 -0
  4. package/bin/exiftool_files/lib/Archive/Zip/Archive.pm +399 -65
  5. package/bin/exiftool_files/lib/Archive/Zip/DirectoryMember.pm +1 -1
  6. package/bin/exiftool_files/lib/Archive/Zip/FileMember.pm +1 -1
  7. package/bin/exiftool_files/lib/Archive/Zip/Member.pm +499 -195
  8. package/bin/exiftool_files/lib/Archive/Zip/NewFileMember.pm +1 -1
  9. package/bin/exiftool_files/lib/Archive/Zip/StringMember.pm +2 -2
  10. package/bin/exiftool_files/lib/Archive/Zip/ZipFileMember.pm +79 -20
  11. package/bin/exiftool_files/lib/Archive/Zip.pm +179 -29
  12. package/bin/exiftool_files/lib/AutoLoader.pm +453 -0
  13. package/bin/exiftool_files/lib/B/Deparse.pm +209 -137
  14. package/bin/exiftool_files/lib/B.pm +1 -1
  15. package/bin/exiftool_files/lib/Benchmark.pm +1123 -0
  16. package/bin/exiftool_files/lib/Class/Struct.pm +2 -2
  17. package/bin/exiftool_files/lib/Compress/Raw/Bzip2.pm +14 -9
  18. package/bin/exiftool_files/lib/Compress/Raw/Lzma.pm +982 -0
  19. package/bin/exiftool_files/lib/Compress/Raw/Zlib.pm +91 -86
  20. package/bin/exiftool_files/lib/Compress/Zlib.pm +105 -100
  21. package/bin/exiftool_files/lib/Config.pm +9 -9
  22. package/bin/exiftool_files/lib/Config_heavy.pl +36 -33
  23. package/bin/exiftool_files/lib/CryptX.pm +2 -82
  24. package/bin/exiftool_files/lib/Data/Dumper.pm +2 -2
  25. package/bin/exiftool_files/lib/Digest/MD5.pm +12 -9
  26. package/bin/exiftool_files/lib/Digest/Perl/MD5.pm +1 -191
  27. package/bin/exiftool_files/lib/Digest/base.pm +26 -20
  28. package/bin/exiftool_files/lib/DynaLoader.pm +7 -4
  29. package/bin/exiftool_files/lib/Encode.pm +3 -3
  30. package/bin/exiftool_files/lib/Errno.pm +13 -13
  31. package/bin/exiftool_files/lib/Exporter/Heavy.pm +2 -2
  32. package/bin/exiftool_files/lib/Exporter.pm +1 -1
  33. package/bin/exiftool_files/lib/ExtUtils/Command/MM.pm +323 -0
  34. package/bin/exiftool_files/lib/ExtUtils/Command.pm +382 -0
  35. package/bin/exiftool_files/lib/File/Find.pm +1 -1
  36. package/bin/exiftool_files/lib/File/Glob.pm +1 -8
  37. package/bin/exiftool_files/lib/File/GlobMapper.pm +2 -2
  38. package/bin/exiftool_files/lib/File/HomeDir/Darwin/Carbon.pm +2 -40
  39. package/bin/exiftool_files/lib/File/HomeDir/Darwin/Cocoa.pm +2 -34
  40. package/bin/exiftool_files/lib/File/HomeDir/Darwin.pm +2 -28
  41. package/bin/exiftool_files/lib/File/HomeDir/Driver.pm +2 -35
  42. package/bin/exiftool_files/lib/File/HomeDir/FreeDesktop.pm +2 -62
  43. package/bin/exiftool_files/lib/File/HomeDir/MacOS9.pm +2 -53
  44. package/bin/exiftool_files/lib/File/HomeDir/Test.pm +2 -43
  45. package/bin/exiftool_files/lib/File/HomeDir/Unix.pm +2 -53
  46. package/bin/exiftool_files/lib/File/HomeDir/Windows.pm +2 -69
  47. package/bin/exiftool_files/lib/File/HomeDir.pm +5 -416
  48. package/bin/exiftool_files/lib/File/Path.pm +3 -3
  49. package/bin/exiftool_files/lib/File/Spec/Win32.pm +2 -2
  50. package/bin/exiftool_files/lib/File/Temp.pm +70 -35
  51. package/bin/exiftool_files/lib/File/Which.pm +1 -240
  52. package/bin/exiftool_files/lib/File/stat.pm +3 -2
  53. package/bin/exiftool_files/lib/IO/Compress/Adapter/Bzip2.pm +16 -17
  54. package/bin/exiftool_files/lib/IO/Compress/Adapter/Deflate.pm +19 -20
  55. package/bin/exiftool_files/lib/IO/Compress/Base/Common.pm +5 -5
  56. package/bin/exiftool_files/lib/IO/Compress/Base.pm +35 -26
  57. package/bin/exiftool_files/lib/IO/Compress/Brotli.pm +159 -0
  58. package/bin/exiftool_files/lib/IO/Compress/Bzip2.pm +50 -25
  59. package/bin/exiftool_files/lib/IO/Compress/Gzip/Constants.pm +6 -6
  60. package/bin/exiftool_files/lib/IO/Compress/Gzip.pm +58 -32
  61. package/bin/exiftool_files/lib/IO/Compress/RawDeflate.pm +63 -38
  62. package/bin/exiftool_files/lib/IO/Compress/Zlib/Extra.pm +20 -20
  63. package/bin/exiftool_files/lib/IO/Dir.pm +1 -1
  64. package/bin/exiftool_files/lib/IO/File.pm +1 -1
  65. package/bin/exiftool_files/lib/IO/Handle.pm +1 -21
  66. package/bin/exiftool_files/lib/IO/Pipe.pm +1 -1
  67. package/bin/exiftool_files/lib/IO/Seekable.pm +1 -1
  68. package/bin/exiftool_files/lib/IO/Select.pm +16 -2
  69. package/bin/exiftool_files/lib/IO/Socket/INET.pm +14 -9
  70. package/bin/exiftool_files/lib/IO/Socket/UNIX.pm +17 -1
  71. package/bin/exiftool_files/lib/IO/Socket.pm +474 -126
  72. package/bin/exiftool_files/lib/IO/String.pm +425 -0
  73. package/bin/exiftool_files/lib/IO/Uncompress/Adapter/Inflate.pm +13 -14
  74. package/bin/exiftool_files/lib/IO/Uncompress/Base.pm +142 -132
  75. package/bin/exiftool_files/lib/IO/Uncompress/Brotli.pm +119 -0
  76. package/bin/exiftool_files/lib/IO/Uncompress/Gunzip.pm +43 -37
  77. package/bin/exiftool_files/lib/IO/Uncompress/RawInflate.pm +49 -43
  78. package/bin/exiftool_files/lib/IO.pm +2 -2
  79. package/bin/exiftool_files/lib/List/Util.pm +97 -8
  80. package/bin/exiftool_files/lib/MIME/Base64.pm +5 -5
  81. package/bin/exiftool_files/lib/MIME/Charset/_Compat.pm +106 -0
  82. package/bin/exiftool_files/lib/MIME/Charset.pm +1303 -0
  83. package/bin/exiftool_files/lib/Math/BigFloat.pm +444 -27
  84. package/bin/exiftool_files/lib/Math/BigInt/Calc.pm +296 -313
  85. package/bin/exiftool_files/lib/Math/BigInt/FastCalc.pm +1 -1
  86. package/bin/exiftool_files/lib/Math/BigInt/GMP.pm +2 -115
  87. package/bin/exiftool_files/lib/Math/BigInt/LTM.pm +2 -24
  88. package/bin/exiftool_files/lib/Math/BigInt/Lib.pm +61 -32
  89. package/bin/exiftool_files/lib/Math/BigInt.pm +292 -107
  90. package/bin/exiftool_files/lib/POSIX.pm +1 -1
  91. package/bin/exiftool_files/lib/PerlIO/scalar.pm +41 -0
  92. package/bin/exiftool_files/lib/PerlIO.pm +397 -0
  93. package/bin/exiftool_files/lib/Portable/CPAN.pm +94 -94
  94. package/bin/exiftool_files/lib/Portable/Config.pm +94 -94
  95. package/bin/exiftool_files/lib/Portable/FileSpec.pm +180 -180
  96. package/bin/exiftool_files/lib/Portable/HomeDir.pm +110 -110
  97. package/bin/exiftool_files/lib/Portable/LoadYaml.pm +430 -430
  98. package/bin/exiftool_files/lib/Portable/minicpan.pm +55 -55
  99. package/bin/exiftool_files/lib/Portable.pm +246 -320
  100. package/bin/exiftool_files/lib/Scalar/Util.pm +9 -4
  101. package/bin/exiftool_files/lib/Socket.pm +16 -12
  102. package/bin/exiftool_files/lib/Storable.pm +1444 -1441
  103. package/bin/exiftool_files/lib/TAP/Base.pm +133 -0
  104. package/bin/exiftool_files/lib/TAP/Formatter/Base.pm +467 -0
  105. package/bin/exiftool_files/lib/TAP/Formatter/Color.pm +116 -0
  106. package/bin/exiftool_files/lib/TAP/Formatter/Console/ParallelSession.pm +201 -0
  107. package/bin/exiftool_files/lib/TAP/Formatter/Console/Session.pm +205 -0
  108. package/bin/exiftool_files/lib/TAP/Formatter/Console.pm +100 -0
  109. package/bin/exiftool_files/lib/TAP/Formatter/File/Session.pm +95 -0
  110. package/bin/exiftool_files/lib/TAP/Formatter/File.pm +56 -0
  111. package/bin/exiftool_files/lib/TAP/Formatter/Session.pm +220 -0
  112. package/bin/exiftool_files/lib/TAP/Harness/Beyond.pod +426 -0
  113. package/bin/exiftool_files/lib/TAP/Harness/Env.pm +215 -0
  114. package/bin/exiftool_files/lib/TAP/Harness.pm +1054 -0
  115. package/bin/exiftool_files/lib/TAP/Object.pm +155 -0
  116. package/bin/exiftool_files/lib/TAP/Parser/Aggregator.pm +414 -0
  117. package/bin/exiftool_files/lib/TAP/Parser/Grammar.pm +584 -0
  118. package/bin/exiftool_files/lib/TAP/Parser/Iterator/Array.pm +100 -0
  119. package/bin/exiftool_files/lib/TAP/Parser/Iterator/Process.pm +378 -0
  120. package/bin/exiftool_files/lib/TAP/Parser/Iterator/Stream.pm +116 -0
  121. package/bin/exiftool_files/lib/TAP/Parser/Iterator.pm +162 -0
  122. package/bin/exiftool_files/lib/TAP/Parser/IteratorFactory.pm +339 -0
  123. package/bin/exiftool_files/lib/TAP/Parser/Multiplexer.pm +194 -0
  124. package/bin/exiftool_files/lib/TAP/Parser/Result/Bailout.pm +62 -0
  125. package/bin/exiftool_files/lib/TAP/Parser/Result/Comment.pm +60 -0
  126. package/bin/exiftool_files/lib/TAP/Parser/Result/Plan.pm +119 -0
  127. package/bin/exiftool_files/lib/TAP/Parser/Result/Pragma.pm +62 -0
  128. package/bin/exiftool_files/lib/TAP/Parser/Result/Test.pm +271 -0
  129. package/bin/exiftool_files/lib/TAP/Parser/Result/Unknown.pm +48 -0
  130. package/bin/exiftool_files/lib/TAP/Parser/Result/Version.pm +62 -0
  131. package/bin/exiftool_files/lib/TAP/Parser/Result/YAML.pm +61 -0
  132. package/bin/exiftool_files/lib/TAP/Parser/Result.pm +297 -0
  133. package/bin/exiftool_files/lib/TAP/Parser/ResultFactory.pm +183 -0
  134. package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Job.pm +127 -0
  135. package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Spinner.pm +61 -0
  136. package/bin/exiftool_files/lib/TAP/Parser/Scheduler.pm +448 -0
  137. package/bin/exiftool_files/lib/TAP/Parser/Source.pm +381 -0
  138. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Executable.pm +184 -0
  139. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/File.pm +136 -0
  140. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Handle.pm +124 -0
  141. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Perl.pm +370 -0
  142. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/RawTAP.pm +130 -0
  143. package/bin/exiftool_files/lib/TAP/Parser/SourceHandler.pm +191 -0
  144. package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Reader.pm +332 -0
  145. package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Writer.pm +254 -0
  146. package/bin/exiftool_files/lib/TAP/Parser.pm +1931 -0
  147. package/bin/exiftool_files/lib/Test/Builder/Formatter.pm +107 -0
  148. package/bin/exiftool_files/lib/Test/Builder/IO/Scalar.pm +659 -0
  149. package/bin/exiftool_files/lib/Test/Builder/Module.pm +182 -0
  150. package/bin/exiftool_files/lib/Test/Builder/Tester/Color.pm +51 -0
  151. package/bin/exiftool_files/lib/Test/Builder/Tester.pm +675 -0
  152. package/bin/exiftool_files/lib/Test/Builder/TodoDiag.pm +68 -0
  153. package/bin/exiftool_files/lib/Test/Builder.pm +2653 -0
  154. package/bin/exiftool_files/lib/Test/Harness.pm +618 -0
  155. package/bin/exiftool_files/lib/Test/More.pm +1997 -0
  156. package/bin/exiftool_files/lib/Test/Simple.pm +220 -0
  157. package/bin/exiftool_files/lib/Test/Tester/Capture.pm +241 -0
  158. package/bin/exiftool_files/lib/Test/Tester/CaptureRunner.pm +79 -0
  159. package/bin/exiftool_files/lib/Test/Tester/Delegate.pm +45 -0
  160. package/bin/exiftool_files/lib/Test/Tester.pm +695 -0
  161. package/bin/exiftool_files/lib/Test/Tutorial.pod +618 -0
  162. package/bin/exiftool_files/lib/Test/use/ok.pm +64 -0
  163. package/bin/exiftool_files/lib/Text/ParseWords.pm +303 -0
  164. package/bin/exiftool_files/lib/Tie/StdHandle.pm +2 -2
  165. package/bin/exiftool_files/lib/Time/HiRes.pm +73 -68
  166. package/bin/exiftool_files/lib/Time/Local.pm +82 -35
  167. package/bin/exiftool_files/lib/Time/Piece.pm +19 -4
  168. package/bin/exiftool_files/lib/Time/Seconds.pm +1 -1
  169. package/bin/exiftool_files/lib/UNIVERSAL.pm +203 -0
  170. package/bin/exiftool_files/lib/Unicode/GCString.pm +60 -0
  171. package/bin/exiftool_files/lib/Unicode/LineBreak/Constants.pm +68 -0
  172. package/bin/exiftool_files/lib/Unicode/LineBreak.pm +248 -0
  173. package/bin/exiftool_files/lib/Win32/API/Struct.pm +1 -177
  174. package/bin/exiftool_files/lib/Win32/API/Type.pm +1 -100
  175. package/bin/exiftool_files/lib/Win32/API.pm +1 -830
  176. package/bin/exiftool_files/lib/Win32/FindFile.pm +2 -123
  177. package/bin/exiftool_files/lib/Win32.pm +213 -89
  178. package/bin/exiftool_files/lib/Win32API/File.pm +1 -1
  179. package/bin/exiftool_files/lib/auto/B/B.xs.dll +0 -0
  180. package/bin/exiftool_files/lib/auto/Compress/Raw/Bzip2/Bzip2.xs.dll +0 -0
  181. package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/Lzma.xs.dll +0 -0
  182. package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/autosplit.ix +3 -0
  183. package/bin/exiftool_files/lib/auto/Compress/Raw/Zlib/Zlib.xs.dll +0 -0
  184. package/bin/exiftool_files/lib/auto/CryptX/CryptX.xs.dll +0 -0
  185. package/bin/exiftool_files/lib/auto/Cwd/Cwd.xs.dll +0 -0
  186. package/bin/exiftool_files/lib/auto/Data/Dumper/Dumper.xs.dll +0 -0
  187. package/bin/exiftool_files/lib/auto/Digest/MD5/MD5.xs.dll +0 -0
  188. package/bin/exiftool_files/lib/auto/Digest/SHA/SHA.xs.dll +0 -0
  189. package/bin/exiftool_files/lib/auto/Encode/Encode.xs.dll +0 -0
  190. package/bin/exiftool_files/lib/auto/Fcntl/Fcntl.xs.dll +0 -0
  191. package/bin/exiftool_files/lib/auto/File/Glob/Glob.xs.dll +0 -0
  192. package/bin/exiftool_files/lib/auto/IO/Compress/Brotli/Brotli.xs.dll +0 -0
  193. package/bin/exiftool_files/lib/auto/IO/IO.xs.dll +0 -0
  194. package/bin/exiftool_files/lib/auto/List/Util/Util.xs.dll +0 -0
  195. package/bin/exiftool_files/lib/auto/MIME/Base64/Base64.xs.dll +0 -0
  196. package/bin/exiftool_files/lib/auto/Math/BigInt/FastCalc/FastCalc.xs.dll +0 -0
  197. package/bin/exiftool_files/lib/auto/Math/BigInt/GMP/GMP.xs.dll +0 -0
  198. package/bin/exiftool_files/lib/auto/POSIX/POSIX.xs.dll +0 -0
  199. package/bin/exiftool_files/lib/auto/PerlIO/scalar/scalar.xs.dll +0 -0
  200. package/bin/exiftool_files/lib/auto/Socket/Socket.xs.dll +0 -0
  201. package/bin/exiftool_files/lib/auto/Storable/Storable.xs.dll +0 -0
  202. package/bin/exiftool_files/lib/auto/Time/HiRes/HiRes.xs.dll +0 -0
  203. package/bin/exiftool_files/lib/auto/Time/Piece/Piece.xs.dll +0 -0
  204. package/bin/exiftool_files/lib/auto/Unicode/LineBreak/LineBreak.xs.dll +0 -0
  205. package/bin/exiftool_files/lib/auto/Win32/API/API.xs.dll +0 -0
  206. package/bin/exiftool_files/lib/auto/Win32/FindFile/FindFile.xs.dll +0 -0
  207. package/bin/exiftool_files/lib/auto/Win32/Win32.xs.dll +0 -0
  208. package/bin/exiftool_files/lib/auto/Win32API/File/File.xs.dll +0 -0
  209. package/bin/exiftool_files/lib/auto/mro/mro.xs.dll +0 -0
  210. package/bin/exiftool_files/lib/auto/re/re.xs.dll +0 -0
  211. package/bin/exiftool_files/lib/feature.pm +49 -17
  212. package/bin/exiftool_files/lib/mro.pm +4 -20
  213. package/bin/exiftool_files/lib/overload.pm +15 -15
  214. package/bin/exiftool_files/lib/parent.pm +10 -2
  215. package/bin/exiftool_files/lib/re.pm +91 -33
  216. package/bin/exiftool_files/lib/warnings.pm +17 -6
  217. package/bin/exiftool_files/libgcc_s_seh-1.dll +0 -0
  218. package/bin/exiftool_files/liblzma-5__.dll +0 -0
  219. package/bin/exiftool_files/libstdc++-6.dll +0 -0
  220. package/bin/exiftool_files/libwinpthread-1.dll +0 -0
  221. package/bin/exiftool_files/perl.exe +0 -0
  222. package/bin/exiftool_files/perl532.dll +0 -0
  223. package/package.json +5 -3
  224. package/bin/exiftool_files/libgcc_s_dw2-1.dll +0 -0
  225. package/bin/exiftool_files/perl530.dll +0 -0
@@ -0,0 +1,453 @@
1
+ package AutoLoader;
2
+
3
+ use strict;
4
+ use 5.006_001;
5
+
6
+ our($VERSION, $AUTOLOAD);
7
+
8
+ my $is_dosish;
9
+ my $is_epoc;
10
+ my $is_vms;
11
+ my $is_macos;
12
+
13
+ BEGIN {
14
+ $is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'NetWare';
15
+ $is_epoc = $^O eq 'epoc';
16
+ $is_vms = $^O eq 'VMS';
17
+ $is_macos = $^O eq 'MacOS';
18
+ $VERSION = '5.74';
19
+ }
20
+
21
+ AUTOLOAD {
22
+ my $sub = $AUTOLOAD;
23
+ autoload_sub($sub);
24
+ goto &$sub;
25
+ }
26
+
27
+ sub autoload_sub {
28
+ my $sub = shift;
29
+
30
+ my $filename = AutoLoader::find_filename( $sub );
31
+
32
+ my $save = $@;
33
+ local $!; # Do not munge the value.
34
+ eval { local $SIG{__DIE__}; require $filename };
35
+ if ($@) {
36
+ if (substr($sub,-9) eq '::DESTROY') {
37
+ no strict 'refs';
38
+ *$sub = sub {};
39
+ $@ = undef;
40
+ } elsif ($@ =~ /^Can't locate/) {
41
+ # The load might just have failed because the filename was too
42
+ # long for some old SVR3 systems which treat long names as errors.
43
+ # If we can successfully truncate a long name then it's worth a go.
44
+ # There is a slight risk that we could pick up the wrong file here
45
+ # but autosplit should have warned about that when splitting.
46
+ if ($filename =~ s/(\w{12,})\.al$/substr($1,0,11).".al"/e){
47
+ eval { local $SIG{__DIE__}; require $filename };
48
+ }
49
+ }
50
+ if ($@){
51
+ $@ =~ s/ at .*\n//;
52
+ my $error = $@;
53
+ require Carp;
54
+ Carp::croak($error);
55
+ }
56
+ }
57
+ $@ = $save;
58
+
59
+ return 1;
60
+ }
61
+
62
+ sub find_filename {
63
+ my $sub = shift;
64
+ my $filename;
65
+ # Braces used to preserve $1 et al.
66
+ {
67
+ # Try to find the autoloaded file from the package-qualified
68
+ # name of the sub. e.g., if the sub needed is
69
+ # Getopt::Long::GetOptions(), then $INC{Getopt/Long.pm} is
70
+ # something like '/usr/lib/perl5/Getopt/Long.pm', and the
71
+ # autoload file is '/usr/lib/perl5/auto/Getopt/Long/GetOptions.al'.
72
+ #
73
+ # However, if @INC is a relative path, this might not work. If,
74
+ # for example, @INC = ('lib'), then $INC{Getopt/Long.pm} is
75
+ # 'lib/Getopt/Long.pm', and we want to require
76
+ # 'auto/Getopt/Long/GetOptions.al' (without the leading 'lib').
77
+ # In this case, we simple prepend the 'auto/' and let the
78
+ # C<require> take care of the searching for us.
79
+
80
+ my ($pkg,$func) = ($sub =~ /(.*)::([^:]+)$/);
81
+ $pkg =~ s#::#/#g;
82
+ if (defined($filename = $INC{"$pkg.pm"})) {
83
+ if ($is_macos) {
84
+ $pkg =~ tr#/#:#;
85
+ $filename = undef
86
+ unless $filename =~ s#^(.*)$pkg\.pm\z#$1auto:$pkg:$func.al#s;
87
+ } else {
88
+ $filename = undef
89
+ unless $filename =~ s#^(.*)$pkg\.pm\z#$1auto/$pkg/$func.al#s;
90
+ }
91
+
92
+ # if the file exists, then make sure that it is a
93
+ # a fully anchored path (i.e either '/usr/lib/auto/foo/bar.al',
94
+ # or './lib/auto/foo/bar.al'. This avoids C<require> searching
95
+ # (and failing) to find the 'lib/auto/foo/bar.al' because it
96
+ # looked for 'lib/lib/auto/foo/bar.al', given @INC = ('lib').
97
+
98
+ if (defined $filename and -r $filename) {
99
+ unless ($filename =~ m|^/|s) {
100
+ if ($is_dosish) {
101
+ unless ($filename =~ m{^([a-z]:)?[\\/]}is) {
102
+ if ($^O ne 'NetWare') {
103
+ $filename = "./$filename";
104
+ } else {
105
+ $filename = "$filename";
106
+ }
107
+ }
108
+ }
109
+ elsif ($is_epoc) {
110
+ unless ($filename =~ m{^([a-z?]:)?[\\/]}is) {
111
+ $filename = "./$filename";
112
+ }
113
+ }
114
+ elsif ($is_vms) {
115
+ # XXX todo by VMSmiths
116
+ $filename = "./$filename";
117
+ }
118
+ elsif (!$is_macos) {
119
+ $filename = "./$filename";
120
+ }
121
+ }
122
+ }
123
+ else {
124
+ $filename = undef;
125
+ }
126
+ }
127
+ unless (defined $filename) {
128
+ # let C<require> do the searching
129
+ $filename = "auto/$sub.al";
130
+ $filename =~ s#::#/#g;
131
+ }
132
+ }
133
+ return $filename;
134
+ }
135
+
136
+ sub import {
137
+ my $pkg = shift;
138
+ my $callpkg = caller;
139
+
140
+ #
141
+ # Export symbols, but not by accident of inheritance.
142
+ #
143
+
144
+ if ($pkg eq 'AutoLoader') {
145
+ if ( @_ and $_[0] =~ /^&?AUTOLOAD$/ ) {
146
+ no strict 'refs';
147
+ *{ $callpkg . '::AUTOLOAD' } = \&AUTOLOAD;
148
+ }
149
+ }
150
+
151
+ #
152
+ # Try to find the autosplit index file. Eg., if the call package
153
+ # is POSIX, then $INC{POSIX.pm} is something like
154
+ # '/usr/local/lib/perl5/POSIX.pm', and the autosplit index file is in
155
+ # '/usr/local/lib/perl5/auto/POSIX/autosplit.ix', so we require that.
156
+ #
157
+ # However, if @INC is a relative path, this might not work. If,
158
+ # for example, @INC = ('lib'), then
159
+ # $INC{POSIX.pm} is 'lib/POSIX.pm', and we want to require
160
+ # 'auto/POSIX/autosplit.ix' (without the leading 'lib').
161
+ #
162
+
163
+ (my $calldir = $callpkg) =~ s#::#/#g;
164
+ my $path = $INC{$calldir . '.pm'};
165
+ if (defined($path)) {
166
+ # Try absolute path name, but only eval it if the
167
+ # transformation from module path to autosplit.ix path
168
+ # succeeded!
169
+ my $replaced_okay;
170
+ if ($is_macos) {
171
+ (my $malldir = $calldir) =~ tr#/#:#;
172
+ $replaced_okay = ($path =~ s#^(.*)$malldir\.pm\z#$1auto:$malldir:autosplit.ix#s);
173
+ } else {
174
+ $replaced_okay = ($path =~ s#^(.*)$calldir\.pm\z#$1auto/$calldir/autosplit.ix#);
175
+ }
176
+
177
+ eval { require $path; } if $replaced_okay;
178
+ # If that failed, try relative path with normal @INC searching.
179
+ if (!$replaced_okay or $@) {
180
+ $path ="auto/$calldir/autosplit.ix";
181
+ eval { require $path; };
182
+ }
183
+ if ($@) {
184
+ my $error = $@;
185
+ require Carp;
186
+ Carp::carp($error);
187
+ }
188
+ }
189
+ }
190
+
191
+ sub unimport {
192
+ my $callpkg = caller;
193
+
194
+ no strict 'refs';
195
+
196
+ for my $exported (qw( AUTOLOAD )) {
197
+ my $symname = $callpkg . '::' . $exported;
198
+ undef *{ $symname } if \&{ $symname } == \&{ $exported };
199
+ *{ $symname } = \&{ $symname };
200
+ }
201
+ }
202
+
203
+ 1;
204
+
205
+ __END__
206
+
207
+ =head1 NAME
208
+
209
+ AutoLoader - load subroutines only on demand
210
+
211
+ =head1 SYNOPSIS
212
+
213
+ package Foo;
214
+ use AutoLoader 'AUTOLOAD'; # import the default AUTOLOAD subroutine
215
+
216
+ package Bar;
217
+ use AutoLoader; # don't import AUTOLOAD, define our own
218
+ sub AUTOLOAD {
219
+ ...
220
+ $AutoLoader::AUTOLOAD = "...";
221
+ goto &AutoLoader::AUTOLOAD;
222
+ }
223
+
224
+ =head1 DESCRIPTION
225
+
226
+ The B<AutoLoader> module works with the B<AutoSplit> module and the
227
+ C<__END__> token to defer the loading of some subroutines until they are
228
+ used rather than loading them all at once.
229
+
230
+ To use B<AutoLoader>, the author of a module has to place the
231
+ definitions of subroutines to be autoloaded after an C<__END__> token.
232
+ (See L<perldata>.) The B<AutoSplit> module can then be run manually to
233
+ extract the definitions into individual files F<auto/funcname.al>.
234
+
235
+ B<AutoLoader> implements an AUTOLOAD subroutine. When an undefined
236
+ subroutine in is called in a client module of B<AutoLoader>,
237
+ B<AutoLoader>'s AUTOLOAD subroutine attempts to locate the subroutine in a
238
+ file with a name related to the location of the file from which the
239
+ client module was read. As an example, if F<POSIX.pm> is located in
240
+ F</usr/local/lib/perl5/POSIX.pm>, B<AutoLoader> will look for perl
241
+ subroutines B<POSIX> in F</usr/local/lib/perl5/auto/POSIX/*.al>, where
242
+ the C<.al> file has the same name as the subroutine, sans package. If
243
+ such a file exists, AUTOLOAD will read and evaluate it,
244
+ thus (presumably) defining the needed subroutine. AUTOLOAD will then
245
+ C<goto> the newly defined subroutine.
246
+
247
+ Once this process completes for a given function, it is defined, so
248
+ future calls to the subroutine will bypass the AUTOLOAD mechanism.
249
+
250
+ =head2 Subroutine Stubs
251
+
252
+ In order for object method lookup and/or prototype checking to operate
253
+ correctly even when methods have not yet been defined it is necessary to
254
+ "forward declare" each subroutine (as in C<sub NAME;>). See
255
+ L<perlsub/"SYNOPSIS">. Such forward declaration creates "subroutine
256
+ stubs", which are place holders with no code.
257
+
258
+ The AutoSplit and B<AutoLoader> modules automate the creation of forward
259
+ declarations. The AutoSplit module creates an 'index' file containing
260
+ forward declarations of all the AutoSplit subroutines. When the
261
+ AutoLoader module is 'use'd it loads these declarations into its callers
262
+ package.
263
+
264
+ Because of this mechanism it is important that B<AutoLoader> is always
265
+ C<use>d and not C<require>d.
266
+
267
+ =head2 Using B<AutoLoader>'s AUTOLOAD Subroutine
268
+
269
+ In order to use B<AutoLoader>'s AUTOLOAD subroutine you I<must>
270
+ explicitly import it:
271
+
272
+ use AutoLoader 'AUTOLOAD';
273
+
274
+ =head2 Overriding B<AutoLoader>'s AUTOLOAD Subroutine
275
+
276
+ Some modules, mainly extensions, provide their own AUTOLOAD subroutines.
277
+ They typically need to check for some special cases (such as constants)
278
+ and then fallback to B<AutoLoader>'s AUTOLOAD for the rest.
279
+
280
+ Such modules should I<not> import B<AutoLoader>'s AUTOLOAD subroutine.
281
+ Instead, they should define their own AUTOLOAD subroutines along these
282
+ lines:
283
+
284
+ use AutoLoader;
285
+ use Carp;
286
+
287
+ sub AUTOLOAD {
288
+ my $sub = $AUTOLOAD;
289
+ (my $constname = $sub) =~ s/.*:://;
290
+ my $val = constant($constname, @_ ? $_[0] : 0);
291
+ if ($! != 0) {
292
+ if ($! =~ /Invalid/ || $!{EINVAL}) {
293
+ $AutoLoader::AUTOLOAD = $sub;
294
+ goto &AutoLoader::AUTOLOAD;
295
+ }
296
+ else {
297
+ croak "Your vendor has not defined constant $constname";
298
+ }
299
+ }
300
+ *$sub = sub { $val }; # same as: eval "sub $sub { $val }";
301
+ goto &$sub;
302
+ }
303
+
304
+ If any module's own AUTOLOAD subroutine has no need to fallback to the
305
+ AutoLoader's AUTOLOAD subroutine (because it doesn't have any AutoSplit
306
+ subroutines), then that module should not use B<AutoLoader> at all.
307
+
308
+ =head2 Package Lexicals
309
+
310
+ Package lexicals declared with C<my> in the main block of a package
311
+ using B<AutoLoader> will not be visible to auto-loaded subroutines, due to
312
+ the fact that the given scope ends at the C<__END__> marker. A module
313
+ using such variables as package globals will not work properly under the
314
+ B<AutoLoader>.
315
+
316
+ The C<vars> pragma (see L<perlmod/"vars">) may be used in such
317
+ situations as an alternative to explicitly qualifying all globals with
318
+ the package namespace. Variables pre-declared with this pragma will be
319
+ visible to any autoloaded routines (but will not be invisible outside
320
+ the package, unfortunately).
321
+
322
+ =head2 Not Using AutoLoader
323
+
324
+ You can stop using AutoLoader by simply
325
+
326
+ no AutoLoader;
327
+
328
+ =head2 B<AutoLoader> vs. B<SelfLoader>
329
+
330
+ The B<AutoLoader> is similar in purpose to B<SelfLoader>: both delay the
331
+ loading of subroutines.
332
+
333
+ B<SelfLoader> uses the C<__DATA__> marker rather than C<__END__>.
334
+ While this avoids the use of a hierarchy of disk files and the
335
+ associated open/close for each routine loaded, B<SelfLoader> suffers a
336
+ startup speed disadvantage in the one-time parsing of the lines after
337
+ C<__DATA__>, after which routines are cached. B<SelfLoader> can also
338
+ handle multiple packages in a file.
339
+
340
+ B<AutoLoader> only reads code as it is requested, and in many cases
341
+ should be faster, but requires a mechanism like B<AutoSplit> be used to
342
+ create the individual files. L<ExtUtils::MakeMaker> will invoke
343
+ B<AutoSplit> automatically if B<AutoLoader> is used in a module source
344
+ file.
345
+
346
+ =head2 Forcing AutoLoader to Load a Function
347
+
348
+ Sometimes, it can be necessary or useful to make sure that a certain
349
+ function is fully loaded by AutoLoader. This is the case, for example,
350
+ when you need to wrap a function to inject debugging code. It is also
351
+ helpful to force early loading of code before forking to make use of
352
+ copy-on-write as much as possible.
353
+
354
+ Starting with AutoLoader 5.73, you can call the
355
+ C<AutoLoader::autoload_sub> function with the fully-qualified name of
356
+ the function to load from its F<.al> file. The behaviour is exactly
357
+ the same as if you called the function, triggering the regular
358
+ C<AUTOLOAD> mechanism, but it does not actually execute the
359
+ autoloaded function.
360
+
361
+ =head1 CAVEATS
362
+
363
+ AutoLoaders prior to Perl 5.002 had a slightly different interface. Any
364
+ old modules which use B<AutoLoader> should be changed to the new calling
365
+ style. Typically this just means changing a require to a use, adding
366
+ the explicit C<'AUTOLOAD'> import if needed, and removing B<AutoLoader>
367
+ from C<@ISA>.
368
+
369
+ On systems with restrictions on file name length, the file corresponding
370
+ to a subroutine may have a shorter name that the routine itself. This
371
+ can lead to conflicting file names. The I<AutoSplit> package warns of
372
+ these potential conflicts when used to split a module.
373
+
374
+ AutoLoader may fail to find the autosplit files (or even find the wrong
375
+ ones) in cases where C<@INC> contains relative paths, B<and> the program
376
+ does C<chdir>.
377
+
378
+ =head1 SEE ALSO
379
+
380
+ L<SelfLoader> - an autoloader that doesn't use external files.
381
+
382
+ =head1 AUTHOR
383
+
384
+ C<AutoLoader> is maintained by the perl5-porters. Please direct
385
+ any questions to the canonical mailing list. Anything that
386
+ is applicable to the CPAN release can be sent to its maintainer,
387
+ though.
388
+
389
+ Author and Maintainer: The Perl5-Porters <perl5-porters@perl.org>
390
+
391
+ Maintainer of the CPAN release: Steffen Mueller <smueller@cpan.org>
392
+
393
+ =head1 COPYRIGHT AND LICENSE
394
+
395
+ This package has been part of the perl core since the first release
396
+ of perl5. It has been released separately to CPAN so older installations
397
+ can benefit from bug fixes.
398
+
399
+ This package has the same copyright and license as the perl core:
400
+
401
+ Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
402
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
403
+ 2011, 2012, 2013
404
+ by Larry Wall and others
405
+
406
+ All rights reserved.
407
+
408
+ This program is free software; you can redistribute it and/or modify
409
+ it under the terms of either:
410
+
411
+ a) the GNU General Public License as published by the Free
412
+ Software Foundation; either version 1, or (at your option) any
413
+ later version, or
414
+
415
+ b) the "Artistic License" which comes with this Kit.
416
+
417
+ This program is distributed in the hope that it will be useful,
418
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
419
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
420
+ the GNU General Public License or the Artistic License for more details.
421
+
422
+ You should have received a copy of the Artistic License with this
423
+ Kit, in the file named "Artistic". If not, I'll be glad to provide one.
424
+
425
+ You should also have received a copy of the GNU General Public License
426
+ along with this program in the file named "Copying". If not, write to the
427
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
428
+ MA 02110-1301, USA or visit their web page on the internet at
429
+ http://www.gnu.org/copyleft/gpl.html.
430
+
431
+ For those of you that choose to use the GNU General Public License,
432
+ my interpretation of the GNU General Public License is that no Perl
433
+ script falls under the terms of the GPL unless you explicitly put
434
+ said script under the terms of the GPL yourself. Furthermore, any
435
+ object code linked with perl does not automatically fall under the
436
+ terms of the GPL, provided such object code only adds definitions
437
+ of subroutines and variables, and does not otherwise impair the
438
+ resulting interpreter from executing any standard Perl script. I
439
+ consider linking in C subroutines in this manner to be the moral
440
+ equivalent of defining subroutines in the Perl language itself. You
441
+ may sell such an object file as proprietary provided that you provide
442
+ or offer to provide the Perl source, as specified by the GNU General
443
+ Public License. (This is merely an alternate way of specifying input
444
+ to the program.) You may also sell a binary produced by the dumping of
445
+ a running Perl script that belongs to you, provided that you provide or
446
+ offer to provide the Perl source as specified by the GPL. (The
447
+ fact that a Perl interpreter and your code are in the same binary file
448
+ is, in this case, a form of mere aggregation.) This is my interpretation
449
+ of the GPL. If you still have concerns or difficulties understanding
450
+ my intent, feel free to contact me. Of course, the Artistic License
451
+ spells all this out for your protection, so you may prefer to use that.
452
+
453
+ =cut