line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Critic::Utils::DataConversion; |
2
|
|
|
|
|
|
|
|
3
|
40
|
|
|
40
|
|
739
|
use 5.010001; |
|
40
|
|
|
|
|
172
|
|
4
|
40
|
|
|
40
|
|
279
|
use strict; |
|
40
|
|
|
|
|
108
|
|
|
40
|
|
|
|
|
925
|
|
5
|
40
|
|
|
40
|
|
242
|
use warnings; |
|
40
|
|
|
|
|
121
|
|
|
40
|
|
|
|
|
1153
|
|
6
|
40
|
|
|
40
|
|
279
|
use Readonly; |
|
40
|
|
|
|
|
161
|
|
|
40
|
|
|
|
|
2280
|
|
7
|
|
|
|
|
|
|
|
8
|
40
|
|
|
40
|
|
331
|
use Perl::Critic::Utils qw{ :characters :booleans }; |
|
40
|
|
|
|
|
120
|
|
|
40
|
|
|
|
|
2389
|
|
9
|
|
|
|
|
|
|
|
10
|
40
|
|
|
40
|
|
10257
|
use Exporter 'import'; |
|
40
|
|
|
|
|
124
|
|
|
40
|
|
|
|
|
5466
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '1.146'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw( |
17
|
|
|
|
|
|
|
dor |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub dor { ## no critic (RequireArgUnpacking) |
23
|
61820
|
|
|
61820
|
1
|
100577
|
foreach (@_) { |
24
|
172934
|
100
|
|
|
|
368440
|
return $_ if defined; |
25
|
|
|
|
|
|
|
} |
26
|
0
|
|
|
|
|
|
return; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=pod |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=for stopwords |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Perl::Critic::Utils::DataConversion - Utilities for converting from one type of data to another. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 DESCRIPTION |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Provides data conversion functions. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 INTERFACE SUPPORT |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
This is considered to be a public module. Any changes to its |
51
|
|
|
|
|
|
|
interface will go through a deprecation cycle. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 IMPORTABLE SUBS |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=over |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=item C<dor( $value, $default )> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Return either the value or the default based upon whether the value is |
61
|
|
|
|
|
|
|
defined or not. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=back |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Elliot Shank <perl@galumph.com> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 COPYRIGHT |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Copyright (c) 2007-2022 Elliot Shank. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
76
|
|
|
|
|
|
|
it under the same terms as Perl itself. The full text of this license |
77
|
|
|
|
|
|
|
can be found in the LICENSE file included with this module. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# Local Variables: |
82
|
|
|
|
|
|
|
# mode: cperl |
83
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
84
|
|
|
|
|
|
|
# fill-column: 78 |
85
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
86
|
|
|
|
|
|
|
# c-indentation-style: bsd |
87
|
|
|
|
|
|
|
# End: |
88
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |