line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hash::Key::Quote; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2019-07-10'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.002'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
55296
|
use 5.010001; |
|
1
|
|
|
|
|
11
|
|
7
|
1
|
|
|
1
|
|
13
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
20
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use Exporter 'import'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
124
|
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
12
|
|
|
|
|
|
|
should_quote_hash_key |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub should_quote_hash_key { |
16
|
16
|
|
|
16
|
1
|
99
|
my $str = shift; |
17
|
16
|
100
|
|
|
|
67
|
return 0 if $str =~ /\A-?[A-Za-z_]\w*\z/; |
18
|
12
|
100
|
|
|
|
38
|
return 0 if $str =~ /\A-?[1-9]\d{0,8}\z/; |
19
|
|
|
|
|
|
|
# TODO: floating point like 123.1, 1.23456789 or -12345678.9 |
20
|
10
|
|
|
|
|
28
|
1; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
# ABSTRACT: Utility routines related to quoting of hash keys |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |