lib/Perlmazing/Perlmazing/Precompile/is_number.pm

filter: Statementstmt 56.2% 9 / 16 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 42.8% 12 / 28 CC 5 SCAR 25.3
CC
5
Cov
38%
main
19.5
BEGIN
1.0
BEGIN
1.0
CRAP 12.5
« lib/Perlmazing/Perlmazing/pl.pm ↑ Summary blib/lib/Perlmazing/Perlmazing/flatten.pm »
1 30 ▶use Perlmazing qw(define not_empty);
Subroutine BEGIN: called CC=1 SCAR=0.0
2 30 ▶use Scalar::Util qw(looks_like_number);
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 0 ▶sub main ($) {
Subroutine main: not called CC=5 SCAR=29.7
5 0 my $i = shift;
6 30 ▶ no warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 0 ▶ return 0 unless not_empty($i);
Branch: 1 branch
BranchTrueFalseTotal
unless &not_empty($i) 0 0 0
8 0 ▶ return 0 if $i =~ /[;:\s\n&=\$%\@\(\)\*]/;
Branch: 1 branch
BranchTrueFalseTotal
if $i =~ /[;:\s\n&=\$%\@\(\)\*]/u 0 0 0
9 0 ▶ return 0 if $i =~ /[^e][\+\-]/;
Branch: 1 branch
BranchTrueFalseTotal
if $i =~ /[^e][\+\-]/u 0 0 0
10 0 ▶ return 1 if $i =~ /^0x\d+$/i; # Not detected by Scalar::Util
Branch: 1 branch
BranchTrueFalseTotal
if $i =~ /^0x\d+$/iu 0 0 0
11 0 $i =~ s/(\d)_(\d)/$1$2/g; # Also not accepted by Scalar::Util
12 0 define looks_like_number $i;;
13 }
14  
« lib/Perlmazing/Perlmazing/pl.pm ↑ Summary blib/lib/Perlmazing/Perlmazing/flatten.pm »