line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use 5.010001; |
3
|
1
|
|
|
1
|
|
5774
|
use strict; |
|
1
|
|
|
|
|
6
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
5
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
175
|
|
6
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
7
|
|
|
|
|
|
|
our $DATE = '2021-12-01'; # DATE |
8
|
|
|
|
|
|
|
our $DIST = 'Sah-Schemas-Perl'; # DIST |
9
|
|
|
|
|
|
|
our $VERSION = '0.042'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
+{ |
12
|
|
|
|
|
|
|
v => 4, |
13
|
|
|
|
|
|
|
summary => 'Coerce perl::modprefix from str', |
14
|
1
|
|
|
1
|
0
|
10
|
prio => 50, |
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my %args = @_; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $dt = $args{data_term}; |
21
|
1
|
|
|
1
|
0
|
14
|
|
22
|
|
|
|
|
|
|
my $res = {}; |
23
|
1
|
|
|
|
|
2
|
|
24
|
|
|
|
|
|
|
$res->{expr_match} = "!ref($dt)"; |
25
|
1
|
|
|
|
|
2
|
$res->{expr_coerce} = join( |
26
|
|
|
|
|
|
|
"", |
27
|
1
|
|
|
|
|
2
|
"do { my \$tmp = $dt;", |
28
|
1
|
|
|
|
|
4
|
" my \$argssuffix = ''; \$argssuffix = \$1 if \$tmp =~ s/(=.*)\\z//;", # extract args suffix (=arg1,arg2) first |
29
|
|
|
|
|
|
|
" my \$versuffix = ''; \$versuffix = \$1 if \$tmp =~ s/(\@[0-9][0-9A-Za-z]*(\\.[0-9A-Za-z_]+)*)\\z//;", # extract version suffix part first |
30
|
|
|
|
|
|
|
" \$tmp =~ s!::?|/|\\.|-!::!g; \$tmp .= '::' if \$tmp =~ /\\A\\w+(::\\w+)*\\z/;", |
31
|
|
|
|
|
|
|
" \$tmp . \$versuffix . \$argssuffix", |
32
|
|
|
|
|
|
|
"}", |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$res; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
3
|
1; |
39
|
|
|
|
|
|
|
# ABSTRACT: |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=pod |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=encoding UTF-8 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 NAME |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Data::Sah::Coerce::perl::To_str::From_str::normalize_perl_modprefix |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 VERSION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
This document describes version 0.042 of Data::Sah::Coerce::perl::To_str::From_str::normalize_perl_modprefix (from Perl distribution Sah-Schemas-Perl), released on 2021-12-01. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 DESCRIPTION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This rule can normalize strings in the form of: |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Foo::Bar |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Foo:Bar |
61
|
|
|
|
|
|
|
Foo:Bar: |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Foo-Bar |
64
|
|
|
|
|
|
|
Foo-Bar- |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Foo/Bar |
67
|
|
|
|
|
|
|
Foo/Bar/ |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Foo.Bar |
70
|
|
|
|
|
|
|
Foo.Bar. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
into: |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Foo::Bar:: |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=for Pod::Coverage ^(meta|coerce)$ |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 HOMEPAGE |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Please visit the project's homepage at L<https://metacpan.org/release/Sah-Schemas-Perl>. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 SOURCE |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Source repository is at L<https://github.com/perlancar/perl-Sah-Schemas-Perl>. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 AUTHOR |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
perlancar <perlancar@cpan.org> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 CONTRIBUTING |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
To contribute, you can send patches by email/via RT, or send pull requests on |
94
|
|
|
|
|
|
|
GitHub. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Most of the time, you don't need to build the distribution yourself. You can |
97
|
|
|
|
|
|
|
simply modify the code, then test via: |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
% prove -l |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
If you want to build the distribution (e.g. to try to install it locally on your |
102
|
|
|
|
|
|
|
system), you can install L<Dist::Zilla>, |
103
|
|
|
|
|
|
|
L<Dist::Zilla::PluginBundle::Author::PERLANCAR>, and sometimes one or two other |
104
|
|
|
|
|
|
|
Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional steps required |
105
|
|
|
|
|
|
|
beyond that are considered a bug and can be reported to me. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This software is copyright (c) 2021, 2020, 2019, 2018, 2017, 2016 by perlancar <perlancar@cpan.org>. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
112
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 BUGS |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Sah-Schemas-Perl> |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
119
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
120
|
|
|
|
|
|
|
feature. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |