forked from rurban/perl-compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathByteLoader.pm
executable file
·70 lines (53 loc) · 1.85 KB
/
ByteLoader.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package ByteLoader;
use XSLoader ();
our $VERSION = '0.09';
# XSLoader problem:
# ByteLoader version 0.0601 required--this is only version 0.06_01 at ./bytecode2.plc line 2.
# on use ByteLoader $ByteLoader::VERSION;
# Fixed with use ByteLoader '$ByteLoader::VERSION';
# Next problem on perl-5.8.3: invalid floating constant suffix _03"
if ($] < 5.009004) {
# Need to check if ByteLoader is not already linked statically.
# Before 5.6 byterun was in CORE, so we have no name clash.
require Config; Config->import();
if ($Config{static_ext} =~ /\bByteLoader\b/) {
# We overrode the static module with our site_perl version. Which version?
# We can only check the perl version and guess from that. From Module::CoreList
$VERSION = '0.03' if $] >= 5.006;
$VERSION = '0.04' if $] >= 5.006001;
$VERSION = '0.05' if $] >= 5.008001;
$VERSION = '0.06' if $] >= 5.009003;
$VERSION = '0.06' if $] >= 5.008008 and $] < 5.009;
} else {
XSLoader::load 'ByteLoader'; # fake the old backwards compatible version
}
} else {
XSLoader::load 'ByteLoader', $VERSION;
}
1;
__END__
=head1 NAME
ByteLoader - load byte compiled perl code
=head1 SYNOPSIS
use ByteLoader 0.08;
<byte code>
perl -MByteLoader bytecode_file.plc
perl -MO=Bytecode,-H,-ofile.plc file.pl
./file.plc
=head1 DESCRIPTION
This module is used to load byte compiled perl code as produced by
C<perl -MO=Bytecode=...>. It uses the source filter mechanism to read
the byte code and insert it into the compiled code at the appropriate point.
=head1 AUTHOR
Tom Hughes <[email protected]> based on the ideas of Tim Bunce and others.
Many changes by Enache Adrian <[email protected]> 2003 a.d.
and Reini Urban <[email protected]> 2008-2011.
=head1 SEE ALSO
perl(1).
=cut
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: