lib/TUI/toolkit/boolean.pm

filter: Statementstmt 82.6% 19 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 80.6% 25 / 31 CC 3 SCAR 7.3
CC
3
Cov
76%
BEGIN
3.9
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« lib/TUI/toolkit/UO/Base.pm ↑ Summary lib/TUI/Dialogs/StrItem.pm »
1 package TUI::toolkit::boolean;
2 # ABSTRACT: Boolean constants for Perl
3
4 133 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 133 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 133 our $VERSION = '0.04';
8
9 133 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
10
11 133 our @EXPORT = qw(
12 true
13 false
14 );
15
16 sub true () { !!1 }
17 sub false () { !!0 }
18
19 # Perl v5.36 and later have a built-in boolean type,
20 # so if it's available, use it.
21 133 ▶BEGIN {
Subroutine BEGIN: called CC=3 SCAR=13.6
22 133 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
23 133 for my $sub ( @EXPORT ) {
24 0 ▶ if ( defined &{ 'builtin::' . $sub } ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined &{'builtin::' . $sub;}) 0 0 0
25 133 ▶ no warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 0 *$sub = \&{ 'builtin::' . $sub };
27 }
28 }
29 }
30
31 133 1
32
33
34 __END__
« lib/TUI/toolkit/UO/Base.pm ↑ Summary lib/TUI/Dialogs/StrItem.pm »