blib/lib/File/Rename/Unicode.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 100% 37 / 37 CC 3 SCAR 5.1
CC
3
Cov
100%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Build ↑ Summary
1 package File::Rename::Unicode;
2
3 2 ▶use 5.012;
Subroutine BEGIN: called CC=1 SCAR=0.0
4
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 2 ▶use Encode qw(encode decode);
Subroutine BEGIN: called CC=1 SCAR=0.0
9
10 2 our $VERSION = '1.30';
11
12 sub code {
13 2 ▶ my $code = shift;
Subroutine code: called CC=1 SCAR=0.0
Pod documented
14 2 my $encoding = shift;
15 return
16 sub {
17 2 ▶ use feature 'unicode_strings';
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶ if ( $encoding ) {
Subroutine __ANON__: called CC=3 SCAR=11.0
Branch: 1 branch
BranchTrueFalseTotal
if ($encoding) { } 1 1 2
19 1 $_ = decode($encoding, $_);
20 }
21 else {
22 1 utf8::upgrade $_;
23 }
24 2 $code->();
25 2 ▶ if ( $encoding ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($encoding) 1 1 2
26 1 $_ = encode($encoding, $_);
27 }
28 2 };
29 }
30
31 2 1;
32
33 __END__
« Build ↑ Summary