File Coverage

lib/String/Numeric.pm
Criterion Covered Total %
statement 17 20 85.0
branch 2 4 50.0
condition 1 3 33.3
subroutine 3 3 100.0
pod n/a
total 23 30 76.6


line stmt bran cond sub pod time code
1             package String::Numeric;
2 6     6   406086 use strict;
  6         16  
  6         248  
3 6     6   33 use warnings;
  6         10  
  6         14685  
4              
5             BEGIN {
6 6     6   16 our $VERSION = 0.9;
7 6         6305 our @EXPORT_OK = qw(
8             is_numeric
9             is_float
10             is_decimal
11             is_integer
12             is_int
13             is_int8
14             is_int16
15             is_int32
16             is_int64
17             is_int128
18             is_uint
19             is_uint8
20             is_uint16
21             is_uint32
22             is_uint64
23             is_uint128
24             );
25              
26 96         235 our %EXPORT_TAGS = (
27             all => [ @EXPORT_OK ],
28 96         215 int => [ grep { /^is_int/ } @EXPORT_OK ],
29 6         42 uint => [ grep { /^is_uint/ } @EXPORT_OK ],
30             );
31              
32 6 50       48 if ( !$ENV{STRING_NUMERIC_PP} ) {
33              
34 0         0 eval {
35 0         0 require String::Numeric::XS;
36             };
37             }
38              
39 6 50 33     52 if ( $ENV{STRING_NUMERIC_PP} || $@ ) {
40 6         5149 require String::Numeric::PP;
41 6         1515 String::Numeric::PP->import(@EXPORT_OK);
42             }
43             else {
44 0         0 String::Numeric::XS->import(@EXPORT_OK);
45             }
46              
47 6         48 require Exporter;
48 6         179 *import = \&Exporter::import;
49             }
50              
51             1;
52              
53             __END__