line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Sane; |
2
|
|
|
|
|
|
|
|
3
|
177
|
|
|
177
|
|
109125
|
use strict; |
|
177
|
|
|
|
|
399
|
|
|
177
|
|
|
|
|
5213
|
|
4
|
177
|
|
|
177
|
|
1025
|
use warnings; |
|
177
|
|
|
|
|
393
|
|
|
177
|
|
|
|
|
7487
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
7
|
|
|
|
|
|
|
|
8
|
177
|
|
|
177
|
|
1125
|
use feature (); |
|
177
|
|
|
|
|
467
|
|
|
177
|
|
|
|
|
4335
|
|
9
|
177
|
|
|
177
|
|
101777
|
use utf8; |
|
177
|
|
|
|
|
2623
|
|
|
177
|
|
|
|
|
968
|
|
10
|
177
|
|
|
177
|
|
85083
|
use IO::File (); |
|
177
|
|
|
|
|
1477697
|
|
|
177
|
|
|
|
|
4248
|
|
11
|
177
|
|
|
177
|
|
1231
|
use IO::Handle (); |
|
177
|
|
|
|
|
382
|
|
|
177
|
|
|
|
|
3268
|
|
12
|
177
|
|
|
177
|
|
81377
|
use Try::Tiny::ByClass; |
|
177
|
|
|
|
|
1482605
|
|
|
177
|
|
|
|
|
10987
|
|
13
|
177
|
|
|
177
|
|
77004
|
use Catmandu::Error (); |
|
177
|
|
|
|
|
1297
|
|
|
177
|
|
|
|
|
24943
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub import { |
16
|
2926
|
|
|
2926
|
|
17029
|
my $pkg = caller; |
17
|
2926
|
|
|
|
|
63753
|
strict->import; |
18
|
2926
|
|
|
|
|
27648
|
warnings->import; |
19
|
2926
|
|
|
|
|
187514
|
feature->import(qw(:5.10)); |
20
|
2926
|
|
|
|
|
18753
|
utf8->import; |
21
|
2926
|
|
|
|
|
354706
|
Try::Tiny::ByClass->export_to_level(1, $pkg); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=pod |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Catmandu::Sane - Package boilerplate |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
use Catmandu::Sane; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Provides all the 5.10 features. |
39
|
|
|
|
|
|
|
say("what"); |
40
|
|
|
|
|
|
|
given($foo) { |
41
|
|
|
|
|
|
|
when(1) { say "1" } |
42
|
|
|
|
|
|
|
when([2,3]) { say "2 or 3" } |
43
|
|
|
|
|
|
|
when(/abc/) { say "has abc" } |
44
|
|
|
|
|
|
|
default { none of the above } |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
sub next_id{ |
47
|
|
|
|
|
|
|
state $id; |
48
|
|
|
|
|
|
|
++$id; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# Provides try/catch[/finally] try/catch_case[/finally] |
52
|
|
|
|
|
|
|
try { |
53
|
|
|
|
|
|
|
} catch {}; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# Provides |
56
|
|
|
|
|
|
|
Catmandu::Error->throw("error"); |
57
|
|
|
|
|
|
|
Catmandu::BadVal->throw("eek val"); |
58
|
|
|
|
|
|
|
Catmandu::BadArg->throw("eek arg"); |
59
|
|
|
|
|
|
|
Catmandu::NotImplemented->throw("can't do that!"); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 DESCRIPTION |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Package boilerplate equivalent to: |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
use strict; |
66
|
|
|
|
|
|
|
use warnings; |
67
|
|
|
|
|
|
|
use feature qw(:5.10); |
68
|
|
|
|
|
|
|
use utf8; |
69
|
|
|
|
|
|
|
use IO::File (); |
70
|
|
|
|
|
|
|
use IO::Handle (); |
71
|
|
|
|
|
|
|
use Try::Tiny::ByClass; |
72
|
|
|
|
|
|
|
use Catmandu::Error; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |