line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Unixish::ucfirst; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
493
|
use 5.010; |
|
1
|
|
|
|
|
6
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
5
|
1
|
|
|
1
|
|
406
|
use syntax 'each_on_array'; # to support perl < 5.12 |
|
1
|
|
|
|
|
24080
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
3559
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
7
|
|
|
|
|
|
|
#use Log::Any '$log'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
471
|
use Data::Unixish::Util qw(%common_args); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
283
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.570'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our %SPEC; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$SPEC{ucfirst} = { |
16
|
|
|
|
|
|
|
v => 1.1, |
17
|
|
|
|
|
|
|
summary => 'Convert first character of text to uppercase', |
18
|
|
|
|
|
|
|
description => <<'_', |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
_ |
21
|
|
|
|
|
|
|
args => { |
22
|
|
|
|
|
|
|
%common_args, |
23
|
|
|
|
|
|
|
}, |
24
|
|
|
|
|
|
|
tags => [qw/text itemfunc/], |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
sub ucfirst { |
27
|
1
|
|
|
1
|
1
|
4
|
my %args = @_; |
28
|
1
|
|
|
|
|
3
|
my ($in, $out) = ($args{in}, $args{out}); |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
16
|
while (my ($index, $item) = each @$in) { |
31
|
5
|
|
|
|
|
13
|
push @$out, _ucfirst_item($item); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
5
|
[200, "OK"]; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _ucfirst_item { |
38
|
10
|
|
|
10
|
|
14
|
my $item = shift; |
39
|
10
|
100
|
66
|
|
|
44
|
if (defined($item) && !ref($item)) { |
40
|
8
|
|
|
|
|
19
|
$item = CORE::ucfirst($item); |
41
|
|
|
|
|
|
|
} |
42
|
10
|
|
|
|
|
82
|
return $item; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
# ABSTRACT: Convert first character of text to uppercase |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |