File Coverage

blib/lib/Ref/Util.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 28 28 100.0


line stmt bran cond sub pod time code
1             package Ref::Util;
2             # ABSTRACT: Utility functions for checking references
3             $Ref::Util::VERSION = '0.204';
4 10     10   1272541 use strict;
  10         55  
  10         290  
5 10     10   48 use warnings;
  10         16  
  10         320  
6              
7 10     10   46 use Exporter 5.57 'import';
  10         235  
  10         1211  
8              
9             {
10             my $impl = $ENV{PERL_REF_UTIL_IMPLEMENTATION}
11             || our $IMPLEMENTATION
12             || 'XS';
13             if ($impl ne 'PP' && eval { require Ref::Util::XS; 1 }) {
14             _install_aliases('Ref::Util::XS');
15             }
16             else {
17             require Ref::Util::PP;
18             _install_aliases('Ref::Util::PP');
19             }
20             }
21              
22             sub _install_aliases {
23 10     10   28 my ($package) = @_;
24 10     10   65 no warnings 'once';
  10         21  
  10         513  
25 10     10   58 no strict 'refs';
  10         17  
  10         1483  
26 10         17 our %EXPORT_TAGS = %{"${package}::EXPORT_TAGS"};
  10         60  
27 10         19 our @EXPORT_OK = @{"${package}::EXPORT_OK"};
  10         52  
28 10         30 *$_ = \&{"${package}::$_"} for '_using_custom_ops', @EXPORT_OK;
  270         938  
29             }
30              
31             1;
32              
33             __END__