line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Sah::Coerce::perl::To_str::From_str::to_cryptocurrency_code; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# AUTHOR |
4
|
|
|
|
|
|
|
our $DATE = '2019-11-28'; # DATE |
5
|
|
|
|
|
|
|
our $DIST = 'Data-Sah-Coerce-perl-To_str-From_str-to_cryptocurrency_code'; # DIST |
6
|
|
|
|
|
|
|
our $VERSION = '0.007'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
1872
|
use 5.010001; |
|
1
|
|
|
|
|
4
|
|
9
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
10
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
159
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub meta { |
13
|
|
|
|
|
|
|
+{ |
14
|
1
|
|
|
1
|
0
|
12
|
v => 4, |
15
|
|
|
|
|
|
|
summary => 'Coerce string containing cryptocurrency code/name/safename to code', |
16
|
|
|
|
|
|
|
might_fail => 1, |
17
|
|
|
|
|
|
|
prio => 50, |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub coerce { |
22
|
1
|
|
|
1
|
0
|
16
|
my %args = @_; |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
2
|
my $dt = $args{data_term}; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
2
|
my $res = {}; |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
3
|
$res->{expr_match} = "!ref($dt)"; |
29
|
1
|
|
50
|
|
|
7
|
$res->{modules}{"CryptoCurrency::Catalog"} //= 0; |
30
|
1
|
|
|
|
|
6
|
$res->{expr_coerce} = join( |
31
|
|
|
|
|
|
|
"", |
32
|
|
|
|
|
|
|
"do { my \$cat = CryptoCurrency::Catalog->new; ", |
33
|
|
|
|
|
|
|
"my \$rec; eval { \$rec = \$cat->by_code($dt) }; if (\$@) { eval { \$rec = \$cat->by_name($dt) } } if (\$@) { eval { \$rec = \$cat->by_safename($dt) } } ", |
34
|
|
|
|
|
|
|
"if (\$@) { ['Unknown cryptocurrency code/name/safename: ' . $dt] } else { [undef, \$rec->{code}] } ", |
35
|
|
|
|
|
|
|
"}", |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
3
|
$res; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
# ABSTRACT: Coerce string containing cryptocurrency code/name/safename to code |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=pod |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=encoding UTF-8 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 NAME |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Data::Sah::Coerce::perl::To_str::From_str::to_cryptocurrency_code - Coerce string containing cryptocurrency code/name/safename to code |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 VERSION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This document describes version 0.007 of Data::Sah::Coerce::perl::To_str::From_str::to_cryptocurrency_code (from Perl distribution Data-Sah-Coerce-perl-To_str-From_str-to_cryptocurrency_code), released on 2019-11-28. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=for Pod::Coverage ^(meta|coerce)$ |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 HOMEPAGE |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Please visit the project's homepage at L<https://metacpan.org/release/Data-Sah-Coerce-perl-To_str-From_str-to_cryptocurrency_code>. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SOURCE |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Source repository is at L<https://github.com/perlancar/perl-Data-Sah-Coerce-perl-To_str-From_str-to_cryptocurrency_code>. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 BUGS |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
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_cryptocurrency_code> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
73
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
74
|
|
|
|
|
|
|
feature. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 AUTHOR |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
perlancar <perlancar@cpan.org> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This software is copyright (c) 2019, 2018 by perlancar@cpan.org. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
85
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |