File Coverage

blib/lib/Hash/Util/Join.pm
Criterion Covered Total %
statement 21 23 91.3
branch 2 4 50.0
condition n/a
subroutine 4 4 100.0
pod n/a
total 27 31 87.1


line stmt bran cond sub pod time code
1             package Hash::Util::Join;
2 1     1   374344 use strict;
  1         2  
  1         40  
3 1     1   7 use warnings;
  1         2  
  1         76  
4              
5 1     1   8 use Exporter qw[import];
  1         2  
  1         314  
6              
7             BEGIN {
8 1     1   5 our $VERSION = '0.07';
9 1         6 our @EXPORT_OK = qw[ hash_inner_join
10             hash_left_join
11             hash_right_join
12             hash_outer_join
13             hash_left_anti_join
14             hash_right_anti_join
15             hash_full_anti_join
16             hash_partition
17             hash_partition_by ];
18              
19 1         19 our %EXPORT_TAGS = (
20             all => \@EXPORT_OK,
21             joins => [qw[ hash_inner_join
22             hash_left_join
23             hash_right_join
24             hash_outer_join
25             hash_left_anti_join
26             hash_right_anti_join
27             hash_full_anti_join ]],
28             partition => [qw[ hash_partition
29             hash_partition_by ]],
30             );
31              
32 1         3 my $use_pp = $ENV{HASH_UTIL_JOIN_PP};
33 1 50       6 if (!$use_pp) {
34 1         2 eval {
35 1         284 require Hash::Util::Join::XS;
36             };
37 1         5 $use_pp = !!$@;
38             }
39              
40 1 50       4 if ($use_pp) {
41 1         567 require Hash::Util::Join::PP;
42 1         79 Hash::Util::Join::PP->import(@EXPORT_OK);
43 1         35 our $IMPLEMENTATION = 'PP';
44             }
45             else {
46 0           Hash::Util::Join::XS->import(@EXPORT_OK);
47 0           our $IMPLEMENTATION = 'XS';
48             }
49             }
50              
51             1;