F.pm

filter: Statementstmt 5.0% 28 / 558 Branchbran 0.0% 0 / 450 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 7.7% 7 / 90 Podpod 100% 1 / 1 totaltotal 3.2% 36 / 1107 CC 229 SCAR 33.9
CC
229
Cov
3%
_fmt_era
210.0
strftime
110.0
__ANON__
42.0
CRAP 29.8
« D.pm ↑ Summary C/Sentinel.pm »
1 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Time::F;
4 9 $Time::F::VERSION = '0.024';
5 # ABSTRACT: Formatting times.
6  
7 9 ▶use Carp qw/ croak /;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 9 ▶use Exporter qw/ import /;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 9 ▶use Function::Parameters qw/ :strict /;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 9 ▶use Time::C::Util qw/ get_fmt_tok get_locale /;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 9 ▶use Time::P;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 9 our @EXPORT = qw/ strftime /;
15  
16  
17 0 ▶my %formatter; %formatter = (
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
18 0 ▶ '%A' => fun ($t, $l) { get_locale(weekdays => $l)->[$t->day_of_week() % 7]; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
19 0 ▶ '%a' => fun ($t, $l) { get_locale(weekdays_abbr => $l)->[$t->day_of_week() % 7]; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
20 0 ▶ '%B' => fun ($t, $l) { get_locale(months => $l)->[$t->month() - 1]; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
21 0 ▶ '%b' => fun ($t, $l) { get_locale(months_abbr => $l)->[$t->month() - 1]; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
22 0 ▶ '%C' => fun ($t, $l) { sprintf '%02d', substr($t->year, -4, 2) + 0; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
23 0 ▶ '%-C' => fun ($t, $l) { substr($t->year, -4, 2) + 0; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
24 0 ▶ '%c' => fun ($t, $l) { strftime($t, get_locale(datetime => $l), locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
25 0 ▶ '%D' => fun ($t, $l) { strftime($t, '%m/%d/%y', locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
26 0 ▶ '%d' => fun ($t, $l) { sprintf '%02d', $t->day; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
27 0 ▶ '%-d' => fun ($t, $l) { $t->day; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
28 0 ▶ '%EC' => fun ($t, $l) { strftime($t, _fmt_era(C => $t, get_locale(era => $l)), locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
29 0 ▶ '%Ec' => fun ($t, $l) { strftime($t, get_locale(era_datetime => $l), locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
30 0 ▶ '%EX' => fun ($t, $l) { strftime($t, get_locale(era_time => $l), locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
31 0 ▶ '%Ex' => fun ($t, $l) { strftime($t, get_locale(era_date => $l), locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
32 0 ▶ '%EY' => fun ($t, $l) { strftime($t, _fmt_era(Y => $t, get_locale(era => $l)), locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
33 0 ▶ '%Ey' => fun ($t, $l) { strftime($t, _fmt_era(y => $t, get_locale(era => $l)), locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
34 0 ▶ '%e' => fun ($t, $l) { sprintf '%2d', $t->day; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
35 0 ▶ '%-e' => fun ($t, $l) { $t->day; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
36 0 ▶ '%F' => fun ($t, $l) { strftime($t, '%Y-%m-%d', locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
37 0 ▶ '%G' => fun ($t, $l) { sprintf '%04d', $t->clone->day_of_week(4)->year; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
38 0 ▶ '%-G' => fun ($t, $l) { $t->clone->day_of_week(4)->year; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
39 0 ▶ '%g' => fun ($t, $l) { sprintf '%02d', substr($formatter{'%G'}->($t, $l), -2); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
40 0 ▶ '%-g' => fun ($t, $l) { substr($formatter{'%G'}->($t, $l), -2) + 0; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
41 0 ▶ '%H' => fun ($t, $l) { sprintf '%02d', $t->hour; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
42 0 ▶ '%-H' => fun ($t, $l) { $t->hour; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
43 0 ▶ '%h' => fun ($t, $l) { $formatter{'%b'}->($t, $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
44 0 ▶ '%I' => fun ($t, $l) { my $I = $t->hour % 12; sprintf '%02d', $I ? $I : 12; },
Subroutine __ANON__: not called CC=4 SCAR=30.0
Branch: 3 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
$I ? : 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
45 0 ▶ '%-I' => fun ($t, $l) { my $I = $t->hour % 12; $I ? $I : 12; },
Subroutine __ANON__: not called CC=4 SCAR=30.0
Branch: 3 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
$I ? : 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
46 0 ▶ '%j' => fun ($t, $l) { sprintf '%03d', $t->day_of_year; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
47 0 ▶ '%-j' => fun ($t, $l) { $t->day_of_year; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
48 0 ▶ '%k' => fun ($t, $l) { sprintf '%2d', $t->hour; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
49 0 ▶ '%-k' => fun ($t, $l) { $t->hour; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
50 0 ▶ '%l' => fun ($t, $l) { my $I = $t->hour % 12; sprintf '%2d', $I ? $I : 12; },
Subroutine __ANON__: not called CC=4 SCAR=30.0
Branch: 3 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
$I ? : 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
51 0 ▶ '%-l' => fun ($t, $l) { my $I = $t->hour % 12; $I ? $I : 12; },
Subroutine __ANON__: not called CC=4 SCAR=30.0
Branch: 3 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
$I ? : 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
52 0 ▶ '%M' => fun ($t, $l) { sprintf '%02d', $t->minute; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
53 0 ▶ '%-M' => fun ($t, $l) { $t->minute; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
54 0 ▶ '%m' => fun ($t, $l) { sprintf '%02d', $t->month; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
55 0 ▶ '%-m' => fun ($t, $l) { $t->month; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
56 0 ▶ '%n' => fun ($t, $l) { "\n"; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
57 0 ▶ '%OC' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
58 0 my @d = @{ get_locale(digits => $l) };
59 0 my $n = $formatter{'%C'}->($t, $l);
60 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
61 0 ▶ croak "Not enough digits in alt_digits for $l to represent %OC." if @d < 100;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 100 0 0 0
62 0 return $d[$n];
63 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
64 0 ▶ '%Od' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
65 0 my @d = @{ get_locale(digits => $l) };
66 0 my $n = $formatter{'%d'}->($t, $l);
67 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
68 0 ▶ croak "Not enough digits in alt_digits for $l to represent %Od." if @d < 32;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 32 0 0 0
69 0 return $d[$n];
70 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
71 0 ▶ '%Oe' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
72 0 my @d = @{ get_locale(digits => $l) };
73 0 my $n = $formatter{'%e'}->($t, $l);
74 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
75 0 ▶ croak "Not enough digits in alt_digits for $l to represent %Oe." if @d < 32;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 32 0 0 0
76 0 return $d[$n];
77 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
78 0 ▶ '%OH' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
79 0 my @d = @{ get_locale(digits => $l) };
80 0 my $n = $formatter{'%H'}->($t, $l);
81 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
82 0 ▶ croak "Not enough digits in alt_digits for $l to represent %OH." if @d < 24;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 24 0 0 0
83 0 return $d[$n];
84 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
85 0 ▶ '%OI' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
86 0 my @d = @{ get_locale(digits => $l) };
87 0 my $n = $formatter{'%I'}->($t, $l);
88 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
89 0 ▶ croak "Not enough digits in alt_digits for $l to represent %OI." if @d < 13;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 13 0 0 0
90 0 return$d[$n];
91 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
92 0 ▶ '%Om' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
93 0 my @d = @{ get_locale(digits => $l) };
94 0 my $n = $formatter{'%m'}->($t, $l);
95 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
96 0 ▶ croak "Not enough digits in alt_digits for $l to represent %Om." if @d < 13;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 13 0 0 0
97 0 return $d[$n];
98 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
99 0 ▶ '%OM' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
100 0 my @d = @{ get_locale(digits => $l) };
101 0 my $n = $formatter{'%M'}->($t, $l);
102 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
103 0 ▶ croak "Not enough digits in alt_digits for $l to represent %OM." if @d < 60;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 60 0 0 0
104 0 return $d[$n];
105 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
106 0 ▶ '%Op' => fun ($t, $l) { $formatter{'%p'}->($t, $l); }, # one %c spec in my_MM locale erroneously says %Op instead of %p
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
107 0 ▶ '%OS' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
108 0 my @d = @{ get_locale(digits => $l) };
109 0 my $n = $formatter{'%S'}->($t, $l);
110 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
111 0 ▶ croak "Not enough digits in alt_digits for $l to represent %OS." if @d < 60;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 60 0 0 0
112 0 return $d[$n];
113 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
114 0 ▶ '%OU' => fun ($t, $l) {
Subroutine __ANON__: not called CC=6 SCAR=37.4
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
115 0 my @d = @{ get_locale(digits => $l) };
116 0 my $n = $formatter{'%U'}->($t, $l);
117 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
118 0 ▶ croak "Not enough digits in alt_digits for $l to represent %OU." if @d < 54;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 54 0 0 0
119 0 ▶ return @d > 31 ? $d[$n] : $n;
Branch: 1 branch
BranchTrueFalseTotal
@d > 31 ? : 0 0 0
120 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
121 0 ▶ '%Ou' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
122 0 my @d = @{ get_locale(digits => $l) };
123 0 my $n = $formatter{'%u'}->($t, $l);
124 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
125 0 ▶ croak "Not enough digits in alt_digits for $l to represent %Ou." if @d < 8;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 8 0 0 0
126 0 return $d[$n];
127 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
128 0 ▶ '%OV' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
129 0 my @d = @{ get_locale(digits => $l) };
130 0 my $n = $formatter{'%V'}->($t, $l);
131 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
132 0 ▶ croak "Not enough digits in alt_digits for $l to represent %OV." if @d < 54;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 54 0 0 0
133 0 return $d[$n];
134 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
135 0 ▶ '%OW' => fun ($t, $l) {
Subroutine __ANON__: not called CC=6 SCAR=37.4
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
136 0 my @d = @{ get_locale(digits => $l) };
137 0 my $n = $formatter{'%W'}->($t, $l);
138 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
139 0 ▶ croak "Not enough digits in alt_digits for $l to represent %OW." if @d < 54;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 54 0 0 0
140 0 ▶ return @d > 31 ? $d[$n] : $n;
Branch: 1 branch
BranchTrueFalseTotal
@d > 31 ? : 0 0 0
141 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
142 0 ▶ '%Ow' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
143 0 my @d = @{ get_locale(digits => $l) };
144 0 my $n = $formatter{'%w'}->($t, $l);
145 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
146 0 ▶ croak "Not enough digits in alt_digits for $l to represent %Ow." if @d < 7;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 7 0 0 0
147 0 return $d[$n];
148 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
149 0 ▶ '%Oy' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
150 0 my @d = @{ get_locale(digits => $l) };
151 0 my $n = $formatter{'%y'}->($t, $l);
152 0 ▶ return $n if @d == 0;
Branch: 1 branch
BranchTrueFalseTotal
if @d == 0 0 0 0
153 0 ▶ croak "Not enough digits in alt_digits for $l to represent %Oy." if @d < 100;
Branch: 1 branch
BranchTrueFalseTotal
if @d < 100 0 0 0
154 0 return $d[$n];
155 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
156 0 ▶ '%P' => fun ($t, $l) { $formatter{'%p'}->($t, $l); }, # a few %r specs in some locales erroneously say %P instead of %p (wal_ET, ur_PK, pa_PK, iw_IL, he_IL, en_GB, dv_MV, cy_GB)
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
157 0 ▶ '%p' => fun ($t, $l) { get_locale(am_pm => $l)->[not $t->hour < 12]; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
158 0 ▶ '%X' => fun ($t, $l) { strftime($t, get_locale(time => $l), locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
159 0 ▶ '%x' => fun ($t, $l) { strftime($t, get_locale(date => $l), locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
160 0 ▶ '%R' => fun ($t, $l) { strftime($t, '%H:%M', locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
161 0 ▶ '%r' => fun ($t, $l) { strftime($t, get_locale(time_ampm => $l), locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
162 0 ▶ '%S' => fun ($t, $l) { sprintf '%02d', $t->second; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
163 0 ▶ '%-S' => fun ($t, $l) { $t->second; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
164 0 ▶ '%s' => fun ($t, $l) { $t->epoch; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
165 0 ▶ '%T' => fun ($t, $l) { strftime($t, '%H:%M:%S', locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
166 0 ▶ '%t' => fun ($t, $l) { "\t"; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
167 0 ▶ '%U' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
168 0 my $t2 = $t->clone->day_of_year(1);
169 0 ▶ $t2->day++ while $t2->day_of_week != 7;
Branch: 1 branch
BranchTrueFalseTotal
$t2->day_of_week != 7 and do { ++$t2->day } 0 0 0
170 0 ▶ if ($t2->day_of_year > $t->day_of_year) { return "00"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($t2->day_of_year > $t->day_of_year) 0 0 0
171 0 sprintf '%02d', int(($t->day_of_year - $t2->day_of_year) / 7) + 1;
172 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
173 0 ▶ '%-U' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
174 0 my $t2 = $t->clone->day_of_year(1);
175 0 ▶ $t2->day++ while $t2->day_of_week != 7;
Branch: 1 branch
BranchTrueFalseTotal
$t2->day_of_week != 7 and do { ++$t2->day } 0 0 0
176 0 ▶ if ($t2->day_of_year > $t->day_of_year) { return "0"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($t2->day_of_year > $t->day_of_year) 0 0 0
177 0 int(($t->day_of_year - $t2->day_of_year) / 7) + 1;
178 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
179 0 ▶ '%u' => fun ($t, $l) { $t->day_of_week; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
180 0 ▶ '%V' => fun ($t, $l) { sprintf '%02d', $t->week; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
181 0 ▶ '%-V' => fun ($t, $l) { $t->week; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
182 0 ▶ '%v' => fun ($t, $l) { strftime($t, '%e-%b-%Y', locale => $l); },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
183 0 ▶ '%W' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
184 0 my $t2 = $t->clone->day_of_year(1);
185 0 ▶ $t2->day++ while $t2->day_of_week != 1;
Branch: 1 branch
BranchTrueFalseTotal
$t2->day_of_week != 1 and do { ++$t2->day } 0 0 0
186 0 ▶ if ($t2->day_of_year > $t->day_of_year) { return "00"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($t2->day_of_year > $t->day_of_year) 0 0 0
187 0 sprintf '%02d', int(($t->day_of_year - $t2->day_of_year) / 7) + 1;
188 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
189 0 ▶ '%-W' => fun ($t, $l) {
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
190 0 my $t2 = $t->clone->day_of_year(1);
191 0 ▶ $t2->day++ while $t2->day_of_week != 1;
Branch: 1 branch
BranchTrueFalseTotal
$t2->day_of_week != 1 and do { ++$t2->day } 0 0 0
192 0 ▶ if ($t2->day_of_year > $t->day_of_year) { return "0"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($t2->day_of_year > $t->day_of_year) 0 0 0
193 0 int(($t->day_of_year - $t2->day_of_year) / 7) + 1;
194 0 ▶ },
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
195 0 ▶ '%w' => fun ($t, $l) { $t->day_of_week == 7 ? 0 : $t->day_of_week; },
Subroutine __ANON__: not called CC=4 SCAR=30.0
Branch: 3 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
$t->day_of_week == 7 ? : 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
196 0 ▶ '%Y' => fun ($t, $l) { sprintf '%04d', $t->year; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
197 0 ▶ '%-Y' => fun ($t, $l) { $t->year; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
198 0 ▶ '%y' => fun ($t, $l) { sprintf '%02d', substr $t->year, -2; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
199 0 ▶ '%-y' => fun ($t, $l) { substr $t->year, -2; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
200 0 ▶ '%Z' => fun ($t, $l) { $t->tz; },
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
201 0 ▶ '%z' => fun ($t, $l) { my $z = $t->offset; sprintf '%s%02s%02s', ($z > 0 ? '-' : '+'), (($z - ($z % 60)) / 60), ($z % 60); },
Subroutine __ANON__: not called CC=4 SCAR=30.0
Branch: 3 branches
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
$z > 0 ? : 0 0 0
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
202 0 ▶ '%%' => fun ($t, $l) { '%'; },
Subroutine __ANON__: not called CC=3 SCAR=21.6
Branch: 1 branch
BranchTrueFalseTotal
@_ > 2 and Function::Parameters::_croak('Too many arguments for fun (anon) (expected 2, got ' . @_ . ')') 0 0 0
203 );
204  
205  
206 0 ▶fun strftime ($t, $fmt, :$locale = 'C') {
Subroutine strftime: not called CC=10 SCAR=47.0
Pod documented
Branch: 4 branches
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for fun strftime (expected 2, got ' . @_ . ')') 0 0 0
@_ > 2 and (@_ - 2) % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun strftime") 0 0 0
exists ${__rest}{'locale'} ? : 0 0 0
keys %{__rest} and Function::Parameters::_croak('In fun strftime: no such named parameter: ' . join(", ", sort(keys %{__rest}))) 0 0 0
Condition0%0/3
@_ > 2 and (@_ - 2) % 2
!ll&&!rl&&r
000
MC/DC0%0/2
@_ > 2 and (@_ - 2) % 2
@_ > 2 (@_ - 2) % 2
Truth table0%0/3
A and B
A= @_ > 2B= (@_ - 2) % 2
ABresult
0X0
100
111
207 0 my $str = '';
208 0 my $pos = 0;
209 0 ▶ while (defined(my $tok = get_fmt_tok($fmt, $pos))) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined(my $tok = get_fmt_tok($fmt, $pos))) 0 0 0
210 0 ▶ if (exists $formatter{$tok}) {
Branch: 2 branches
BranchTrueFalseTotal
if (exists $formatter{$tok}) { } 0 0 0
elsif ($tok =~ /^%/) { } 0 0 0
211 0 ▶ $str .= $formatter{$tok}->($t, $locale) // '';
Condition0%0/2
$formatter{$tok}->($t, $locale) // ""
l!l
00
MC/DC0%0/1
$formatter{$tok}->($t, $locale) // ""
$formatter{$tok}->($t, $locale)
Truth table0%0/2
A
A= $formatter{$tok}->($t, $locale)
Aresult
11
00
212 } elsif ($tok =~ m/^%/) {
213 0 croak "Unsupported format specifier: $tok"
214 } else {
215 0 $str .= $tok;
216 }
217 }
218  
219 0 return $str;
220 9 }
221  
222 0 ▶fun _fmt_era ($E, $t, $eras) {
Subroutine _fmt_era: not called CC=14 SCAR=53.5
Branch: 2 branches
BranchTrueFalseTotal
@_ < 3 and Function::Parameters::_croak('Too few arguments for fun _fmt_era (expected 3, got ' . @_ . ')') 0 0 0
@_ > 3 and Function::Parameters::_croak('Too many arguments for fun _fmt_era (expected 3, got ' . @_ . ')') 0 0 0
223 0 foreach my $era (grep defined, @{ $eras }) {
224 0 my @fields = split /:/, $era;
225 0 my %s = strptime($fields[2], "%-Y/%m/%d");
226 0 ▶ $s{year}++ if $s{year} < 1;
Branch: 1 branch
BranchTrueFalseTotal
if $s{"year"} < 1 0 0 0
227 0 ▶ if ($t->year > $s{year}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($t->year > $s{'year'}) { } 0 0 0
elsif ($t->year == $s{'year'}) { } 0 0 0
228 0 ▶ return $fields[5] if $E eq 'Y';
Branch: 1 branch
BranchTrueFalseTotal
if $E eq "Y" 0 0 0
229 0 ▶ return $fields[4] if $E eq 'C';
Branch: 1 branch
BranchTrueFalseTotal
if $E eq "C" 0 0 0
230 0 ▶ return $fields[1] + $t->year - $s{year} if $E eq 'y';
Branch: 1 branch
BranchTrueFalseTotal
if $E eq "y" 0 0 0
231 } elsif ($t->year == $s{year}) {
232 0 require Time::C;
233 0 my $s = Time::C->mktime(%s);
234 0 ▶ if ($t->epoch >= $s->epoch) {
Branch: 1 branch
BranchTrueFalseTotal
if ($t->epoch >= $s->epoch) 0 0 0
235 0 ▶ return $fields[5] if $E eq 'Y';
Branch: 1 branch
BranchTrueFalseTotal
if $E eq "Y" 0 0 0
236 0 ▶ return $fields[4] if $E eq 'C';
Branch: 1 branch
BranchTrueFalseTotal
if $E eq "C" 0 0 0
237 0 ▶ return $fields[1] + $t->year - $s{year} if $E eq 'y';
Branch: 1 branch
BranchTrueFalseTotal
if $E eq "y" 0 0 0
238 }
239 }
240 }
241 0 return "%$E";
242 9 }
243  
244 9 1;
245  
246 __END__
« D.pm ↑ Summary C/Sentinel.pm »