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   269874 use strict;
  6         19  
  6         241  
3 6     6   77 use warnings;
  6         13  
  6         1702  
4              
5             BEGIN {
6 6     6   20 our $VERSION = '0.9_01';
7 6         32 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         209 our %EXPORT_TAGS = (
27             all => [ @EXPORT_OK ],
28 96         220 int => [ grep { /^is_int/ } @EXPORT_OK ],
29 6         29 uint => [ grep { /^is_uint/ } @EXPORT_OK ],
30             );
31              
32 6 50       60 if ( !$ENV{STRING_NUMERIC_PP} ) {
33 0         0 eval {
34 0         0 require String::Numeric::XS;
35             };
36             }
37              
38 6 50 33     42 if ( $ENV{STRING_NUMERIC_PP} || $@ ) {
39 6         10341 require String::Numeric::PP;
40 6         771 String::Numeric::PP->import(@EXPORT_OK);
41             }
42             else {
43 0         0 String::Numeric::XS->import(@EXPORT_OK);
44             }
45              
46 6         45 require Exporter;
47 6         292 *import = \&Exporter::import;
48             }
49              
50             1;
51              
52             __END__