File Coverage

blib/lib/ByteLoader.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package ByteLoader;
2              
3 1     1   4 use XSLoader ();
  1         1  
  1         144  
4             our $VERSION = '0.11';
5             # XSLoader problem:
6             # ByteLoader version 0.0601 required--this is only version 0.06_01 at ./bytecode2.plc line 2.
7             # on use ByteLoader $ByteLoader::VERSION;
8             # Fixed with use ByteLoader '$ByteLoader::VERSION';
9             # Next problem on perl-5.8.3: invalid floating constant suffix _03"
10              
11             if ($] < 5.009004) {
12             # Need to check if ByteLoader is not already linked statically.
13             # Before 5.6 byterun was in CORE, so we have no name clash.
14             require Config; Config->import();
15             if ($Config{static_ext} =~ /\bByteLoader\b/) {
16             # We overrode the static module with our site_perl version. Which version?
17             # We can only check the perl version and guess from that. From Module::CoreList
18             $VERSION = '0.03' if $] >= 5.006;
19             $VERSION = '0.04' if $] >= 5.006001;
20             $VERSION = '0.05' if $] >= 5.008001;
21             $VERSION = '0.06' if $] >= 5.009003;
22             $VERSION = '0.06' if $] >= 5.008008 and $] < 5.009;
23             } else {
24             XSLoader::load 'ByteLoader'; # fake the old backwards compatible version
25             }
26             } else {
27             XSLoader::load 'ByteLoader', $VERSION;
28             }
29              
30             1;
31             __END__