File Coverage

blib/arch/Config.pm
Criterion Covered Total %
statement 0 16 0.0
branch 0 12 0.0
condition n/a
subroutine 0 3 0.0
pod n/a
total 0 31 0.0


line stmt bran cond sub pod time code
1             # This is XSConfig from CPAN that uses XSLoader
2              
3             # for a description of the variables, please have a look at the
4             # Porting/Glossary file, or use the url:
5             # http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/Glossary
6              
7             package
8             Config;
9             use strict;
10             use warnings;
11             our (%Config, $VERSION);
12              
13             $VERSION = '6.25_01';
14              
15             # Skip @Config::EXPORT because it only contains %Config, which we special
16             # case below as it's not a function. @Config::EXPORT won't change in the
17             # lifetime of Perl 5.
18             my %Export_Cache = (myconfig => 1, config_sh => 1, config_vars => 1,
19             config_re => 1, compile_date => 1, local_patches => 1,
20             bincompat_options => 1, non_bincompat_options => 1,
21             header_files => 1);
22              
23             @Config::EXPORT = qw(%Config);
24             @Config::EXPORT_OK = keys %Export_Cache;
25              
26             # Need to stub all the functions to make code such as print Config::config_sh
27             # keep working
28              
29             sub bincompat_options;
30             sub compile_date;
31             sub config_re;
32             sub config_sh;
33             sub config_vars;
34             sub header_files;
35             sub local_patches;
36             sub myconfig;
37             sub non_bincompat_options;
38              
39             # Define our own import method to avoid pulling in the full Exporter:
40             sub import {
41 0     0     shift;
42 0 0         @_ = @Config::EXPORT unless @_;
43              
44 0           my @funcs = grep $_ ne '%Config', @_;
45 0 0         my $export_Config = @funcs < @_ ? 1 : 0;
46              
47             no strict 'refs';
48 0           my $callpkg = caller(0);
49 0           foreach my $func (@funcs) {
50             die qq{"$func" is not exported by the Config module\n}
51 0 0         unless $Export_Cache{$func};
52 0           *{$callpkg.'::'.$func} = \&{$func};
  0            
  0            
53             }
54              
55 0 0         *{"$callpkg\::Config"} = \%Config if $export_Config;
  0            
56 0           return;
57             }
58              
59       0     sub DESTROY { }
60              
61             if (defined &DynaLoader::boot_DynaLoader) {
62             require XSLoader;
63             XSLoader::load(__PACKAGE__, $VERSION);
64             tie %Config, 'Config';
65             } else {
66             no warnings 'redefine';
67             %Config:: = ();
68             undef &{$_} for qw(import DESTROY AUTOLOAD);
69             require 'Config_mini.pl';
70             }
71              
72             sub AUTOLOAD {
73 0 0   0     require 'Config_xs_heavy.pl' if defined &DynaLoader::boot_DynaLoader;
74              
75 0 0         goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
76 0           die "&Config::AUTOLOAD failed on $Config::AUTOLOAD";
77             }