line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Sah::Coerce::perl::To_str::From_str::to_upper_first; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# AUTHOR |
4
|
|
|
|
|
|
|
our $DATE = '2019-11-28'; # DATE |
5
|
|
|
|
|
|
|
our $DIST = 'Data-Sah-Coerce-perl-To_str-From_str-to_upper'; # DIST |
6
|
|
|
|
|
|
|
our $VERSION = '0.006'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
2067
|
use 5.010001; |
|
1
|
|
|
|
|
4
|
|
9
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
10
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
138
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub meta { |
13
|
|
|
|
|
|
|
+{ |
14
|
1
|
|
|
1
|
0
|
13
|
v => 4, |
15
|
|
|
|
|
|
|
summary => "Coerce string's first character to upper case", |
16
|
|
|
|
|
|
|
prio => 50, |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub coerce { |
21
|
1
|
|
|
1
|
0
|
14
|
my %args = @_; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
3
|
my $dt = $args{data_term}; |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
2
|
my $res = {}; |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
2
|
$res->{expr_match} = "!ref($dt)"; |
28
|
1
|
|
|
|
|
4
|
$res->{expr_coerce} = join( |
29
|
|
|
|
|
|
|
"", |
30
|
|
|
|
|
|
|
"ucfirst($dt)", |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
3
|
$res; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
# ABSTRACT: Coerce string's first character to upper case |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=pod |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=encoding UTF-8 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Data::Sah::Coerce::perl::To_str::From_str::to_upper_first - Coerce string's first character to upper case |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 VERSION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
This document describes version 0.006 of Data::Sah::Coerce::perl::To_str::From_str::to_upper_first (from Perl distribution Data-Sah-Coerce-perl-To_str-From_str-to_upper), released on 2019-11-28. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SYNOPSIS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
To use in a Sah schema: |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
["str",{"x.perl.coerce_rules"=>["From_str::to_upper_first"]}] |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=for Pod::Coverage ^(meta|coerce)$ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 HOMEPAGE |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Please visit the project's homepage at L<https://metacpan.org/release/Data-Sah-Coerce-perl-To_str-From_str-to_upper>. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SOURCE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Source repository is at L<https://github.com/perlancar/perl-Data-Sah-Coerce-perl-To_str-From_str-to_upper>. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 BUGS |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah-Coerce-perl-To_str-From_str-to_upper> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
74
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
75
|
|
|
|
|
|
|
feature. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 AUTHOR |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
perlancar <perlancar@cpan.org> |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This software is copyright (c) 2019, 2018 by perlancar@cpan.org. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
86
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |