line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Exception::Loader; |
2
|
|
|
|
|
|
|
$HTTP::Exception::Loader::VERSION = '0.04006'; |
3
|
28
|
|
|
28
|
|
171
|
use strict; |
|
28
|
|
|
|
|
54
|
|
|
28
|
|
|
|
|
1314
|
|
4
|
28
|
|
|
28
|
|
153
|
use warnings; |
|
28
|
|
|
|
|
49
|
|
|
28
|
|
|
|
|
1118
|
|
5
|
|
|
|
|
|
|
|
6
|
28
|
|
|
28
|
|
26040
|
use HTTP::Exception::Base; |
|
28
|
|
|
|
|
82
|
|
|
28
|
|
|
|
|
1017
|
|
7
|
28
|
|
|
28
|
|
18979
|
use HTTP::Exception::1XX; |
|
28
|
|
|
|
|
77
|
|
|
28
|
|
|
|
|
948
|
|
8
|
28
|
|
|
28
|
|
14716
|
use HTTP::Exception::2XX; |
|
28
|
|
|
|
|
73
|
|
|
28
|
|
|
|
|
833
|
|
9
|
28
|
|
|
28
|
|
27736
|
use HTTP::Exception::3XX; |
|
28
|
|
|
|
|
77
|
|
|
28
|
|
|
|
|
1056
|
|
10
|
28
|
|
|
28
|
|
26216
|
use HTTP::Exception::4XX; |
|
28
|
|
|
|
|
80
|
|
|
28
|
|
|
|
|
1011
|
|
11
|
28
|
|
|
28
|
|
16924
|
use HTTP::Exception::5XX; |
|
28
|
|
|
|
|
76
|
|
|
28
|
|
|
|
|
1402
|
|
12
|
28
|
|
|
28
|
|
164
|
use HTTP::Status; |
|
28
|
|
|
|
|
53
|
|
|
28
|
|
|
|
|
12710
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
################################################################################ |
15
|
|
|
|
|
|
|
# little bit messy, but solid |
16
|
|
|
|
|
|
|
# - first create packages for Exception::Class, so it can create them on its own |
17
|
|
|
|
|
|
|
# - then extend those packages by putting methods into the same namespace |
18
|
|
|
|
|
|
|
sub _make_exceptions { |
19
|
28
|
|
|
28
|
|
119
|
my %tags = @_; |
20
|
28
|
|
|
|
|
62
|
my (@http_statuses, @exception_classes); |
21
|
|
|
|
|
|
|
{ |
22
|
28
|
|
|
28
|
|
182
|
no strict 'refs'; |
|
28
|
|
|
|
|
480
|
|
|
28
|
|
|
|
|
9127
|
|
|
28
|
|
|
|
|
52
|
|
23
|
28
|
|
|
|
|
62
|
@http_statuses = grep { /^HTTP_/ } (keys %{"HTTP::Status::"}); |
|
3668
|
|
|
|
|
7692
|
|
|
28
|
|
|
|
|
1176
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
28
|
|
|
|
|
756
|
my $code = ''; |
27
|
28
|
|
|
|
|
92
|
for my $http_status (@http_statuses) { |
28
|
1624
|
|
|
|
|
4542
|
my $statuscode = HTTP::Status->$http_status; |
29
|
1624
|
|
|
|
|
5452
|
my $http_status_message = HTTP::Status::status_message($statuscode); |
30
|
1624
|
|
|
|
|
6217
|
my $statuscode_range = $statuscode; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# remove HTTP_ for exception classname |
33
|
1624
|
|
|
|
|
5350
|
$http_status =~ s/^HTTP_//; |
34
|
|
|
|
|
|
|
# replace the last 2 digits with XX for basename creation |
35
|
1624
|
|
|
|
|
4602
|
$statuscode_range =~ s/\d{2}$/XX/; |
36
|
|
|
|
|
|
|
# poor mans escaping, because of HTTP: 418 / I'm a teapot :\ |
37
|
1624
|
|
|
|
|
2253
|
$http_status_message =~ s/'/\\'/g; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# only create requested classes |
40
|
1624
|
100
|
|
|
|
3821
|
next unless (exists $tags{$statuscode_range}); |
41
|
|
|
|
|
|
|
|
42
|
1233
|
|
|
|
|
2135
|
my $package_name_code = 'HTTP::Exception::'.$statuscode; |
43
|
1233
|
|
|
|
|
2138
|
my $package_name_base = 'HTTP::Exception::'.$statuscode_range; |
44
|
1233
|
|
|
|
|
1985
|
my $package_name_message = 'HTTP::Exception::'.$http_status; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# create a Package like HTTP::Exception::404, |
47
|
|
|
|
|
|
|
# but also a Package HTTP::Exception::NOT_FOUND, |
48
|
|
|
|
|
|
|
# which inherits from HTTP::Exception::404 |
49
|
|
|
|
|
|
|
# HTTP::Exception::404 inherits from HTTP::Exception::4XX |
50
|
1233
|
|
|
|
|
4817
|
push @exception_classes, |
51
|
|
|
|
|
|
|
$package_name_code => {isa => $package_name_base}, |
52
|
|
|
|
|
|
|
$package_name_message => {isa => $package_name_code}; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# TODO check whether evaled subs with a ()-prototype are compiled to constants |
55
|
1233
|
|
|
|
|
8061
|
$code .= qq~ |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
package $package_name_code; |
58
|
|
|
|
|
|
|
sub code () { $statuscode } |
59
|
|
|
|
|
|
|
sub _status_message () { '$http_status_message' } |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
package $package_name_message; |
62
|
|
|
|
|
|
|
use Scalar::Util qw(blessed); |
63
|
|
|
|
|
|
|
sub caught { |
64
|
|
|
|
|
|
|
my \$self = shift; |
65
|
|
|
|
|
|
|
my \$e = \$@; |
66
|
|
|
|
|
|
|
return \$e if (blessed \$e && \$e->isa('$package_name_code')); |
67
|
|
|
|
|
|
|
\$self->SUPER::caught(\@_); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
~; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# RT https://rt.cpan.org/Ticket/Display.html?id=79021 |
74
|
|
|
|
|
|
|
# silence warnings about "subroutine redefined" in a mod_perl environment |
75
|
|
|
|
|
|
|
{ |
76
|
28
|
|
|
28
|
|
186
|
no warnings 'redefine'; |
|
28
|
|
|
|
|
50
|
|
|
28
|
|
|
|
|
9617
|
|
|
28
|
|
|
|
|
76
|
|
77
|
28
|
50
|
33
|
28
|
|
371
|
eval $code; |
|
28
|
50
|
33
|
28
|
|
59
|
|
|
28
|
50
|
33
|
28
|
|
5659
|
|
|
28
|
50
|
33
|
27
|
|
169
|
|
|
28
|
50
|
33
|
27
|
|
67
|
|
|
28
|
50
|
33
|
27
|
|
5333
|
|
|
28
|
50
|
33
|
27
|
|
159
|
|
|
28
|
100
|
66
|
25
|
|
65
|
|
|
28
|
50
|
33
|
25
|
|
5380
|
|
|
27
|
50
|
33
|
24
|
|
294
|
|
|
27
|
50
|
33
|
24
|
|
67
|
|
|
27
|
50
|
33
|
22
|
|
4797
|
|
|
27
|
50
|
33
|
22
|
|
159
|
|
|
27
|
50
|
33
|
22
|
|
51
|
|
|
27
|
50
|
33
|
22
|
|
5266
|
|
|
27
|
50
|
33
|
22
|
|
159
|
|
|
27
|
50
|
33
|
22
|
|
49
|
|
|
27
|
50
|
33
|
22
|
|
5272
|
|
|
27
|
50
|
33
|
22
|
|
147
|
|
|
27
|
50
|
33
|
22
|
|
58
|
|
|
27
|
50
|
33
|
22
|
|
13015
|
|
|
25
|
50
|
33
|
22
|
|
151
|
|
|
25
|
50
|
33
|
22
|
|
47
|
|
|
25
|
50
|
33
|
22
|
|
5326
|
|
|
25
|
50
|
33
|
22
|
|
137
|
|
|
25
|
50
|
33
|
22
|
|
39
|
|
|
25
|
50
|
33
|
22
|
|
7056
|
|
|
24
|
50
|
33
|
22
|
|
168
|
|
|
24
|
50
|
33
|
20
|
|
53
|
|
|
24
|
50
|
33
|
20
|
|
10966
|
|
|
24
|
50
|
33
|
20
|
|
138
|
|
|
24
|
50
|
33
|
20
|
|
48
|
|
|
24
|
50
|
33
|
20
|
|
4052
|
|
|
22
|
50
|
33
|
20
|
|
123
|
|
|
22
|
50
|
33
|
20
|
|
41
|
|
|
22
|
50
|
33
|
20
|
|
3812
|
|
|
22
|
50
|
33
|
20
|
|
120
|
|
|
22
|
50
|
33
|
20
|
|
40
|
|
|
22
|
50
|
33
|
20
|
|
3562
|
|
|
22
|
50
|
33
|
19
|
|
115
|
|
|
22
|
50
|
33
|
19
|
|
41
|
|
|
22
|
50
|
33
|
19
|
|
3695
|
|
|
22
|
50
|
33
|
19
|
|
156
|
|
|
22
|
50
|
33
|
19
|
|
39
|
|
|
22
|
50
|
33
|
19
|
|
4022
|
|
|
22
|
50
|
33
|
19
|
|
376
|
|
|
22
|
50
|
33
|
18
|
|
43
|
|
|
22
|
50
|
33
|
17
|
|
3837
|
|
|
22
|
50
|
33
|
17
|
|
125
|
|
|
22
|
50
|
33
|
17
|
|
40
|
|
|
22
|
50
|
33
|
17
|
|
3886
|
|
|
22
|
50
|
33
|
17
|
|
128
|
|
|
22
|
50
|
33
|
17
|
|
49
|
|
|
22
|
50
|
33
|
17
|
|
17168
|
|
|
22
|
50
|
33
|
17
|
|
143
|
|
|
22
|
50
|
33
|
17
|
|
80
|
|
|
22
|
50
|
33
|
17
|
|
4092
|
|
|
22
|
50
|
33
|
17
|
|
126
|
|
|
22
|
|
|
1
|
|
37
|
|
|
22
|
|
|
1
|
|
3838
|
|
|
22
|
|
|
1
|
|
121
|
|
|
22
|
|
|
1
|
|
42
|
|
|
22
|
|
|
1
|
|
4068
|
|
|
22
|
|
|
1
|
|
135
|
|
|
22
|
|
|
1
|
|
59
|
|
|
22
|
|
|
4
|
|
4651
|
|
|
22
|
|
|
1
|
|
124
|
|
|
22
|
|
|
1
|
|
47
|
|
|
22
|
|
|
1
|
|
4011
|
|
|
22
|
|
|
1
|
|
124
|
|
|
22
|
|
|
1
|
|
40
|
|
|
22
|
|
|
1
|
|
6887
|
|
|
22
|
|
|
1
|
|
120
|
|
|
22
|
|
|
1
|
|
2597
|
|
|
22
|
|
|
1
|
|
5632
|
|
|
22
|
|
|
1
|
|
138
|
|
|
22
|
|
|
8
|
|
57
|
|
|
22
|
|
|
2
|
|
3649
|
|
|
22
|
|
|
1
|
|
129
|
|
|
22
|
|
|
1
|
|
39
|
|
|
22
|
|
|
4
|
|
13069
|
|
|
22
|
|
|
1
|
|
226
|
|
|
22
|
|
|
1
|
|
50
|
|
|
22
|
|
|
1
|
|
8951
|
|
|
20
|
|
|
1
|
|
126
|
|
|
20
|
|
|
1
|
|
1208
|
|
|
20
|
|
|
1
|
|
12051
|
|
|
20
|
|
|
1
|
|
251
|
|
|
20
|
|
|
1
|
|
1548
|
|
|
20
|
|
|
1
|
|
6018
|
|
|
20
|
|
|
1
|
|
107
|
|
|
20
|
|
|
1
|
|
33
|
|
|
20
|
|
|
1
|
|
3827
|
|
|
20
|
|
|
1
|
|
112
|
|
|
20
|
|
|
1
|
|
44
|
|
|
20
|
|
|
1
|
|
5683
|
|
|
20
|
|
|
1
|
|
111
|
|
|
20
|
|
|
1
|
|
32
|
|
|
20
|
|
|
1
|
|
3523
|
|
|
20
|
|
|
1
|
|
1932
|
|
|
20
|
|
|
1
|
|
66
|
|
|
20
|
|
|
1
|
|
3837
|
|
|
20
|
|
|
1
|
|
193
|
|
|
20
|
|
|
1
|
|
38
|
|
|
20
|
|
|
1
|
|
3938
|
|
|
20
|
|
|
1
|
|
275
|
|
|
20
|
|
|
1
|
|
32
|
|
|
20
|
|
|
1
|
|
4026
|
|
|
20
|
|
|
1
|
|
133
|
|
|
20
|
|
|
1
|
|
33
|
|
|
20
|
|
|
1
|
|
10059
|
|
|
20
|
|
|
1
|
|
104
|
|
|
20
|
|
|
1
|
|
30
|
|
|
20
|
|
|
1
|
|
4207
|
|
|
20
|
|
|
1
|
|
111
|
|
|
20
|
|
|
1
|
|
30
|
|
|
20
|
|
|
|
|
3137
|
|
|
19
|
|
|
|
|
92
|
|
|
19
|
|
|
|
|
34
|
|
|
19
|
|
|
|
|
3158
|
|
|
19
|
|
|
|
|
93
|
|
|
19
|
|
|
|
|
29
|
|
|
19
|
|
|
|
|
3112
|
|
|
19
|
|
|
|
|
94
|
|
|
19
|
|
|
|
|
29
|
|
|
19
|
|
|
|
|
3439
|
|
|
19
|
|
|
|
|
103
|
|
|
19
|
|
|
|
|
28
|
|
|
19
|
|
|
|
|
3104
|
|
|
19
|
|
|
|
|
108
|
|
|
19
|
|
|
|
|
32
|
|
|
19
|
|
|
|
|
4900
|
|
|
19
|
|
|
|
|
99
|
|
|
19
|
|
|
|
|
37
|
|
|
19
|
|
|
|
|
5276
|
|
|
19
|
|
|
|
|
185
|
|
|
19
|
|
|
|
|
33
|
|
|
19
|
|
|
|
|
3178
|
|
|
18
|
|
|
|
|
96
|
|
|
18
|
|
|
|
|
26
|
|
|
18
|
|
|
|
|
2848
|
|
|
17
|
|
|
|
|
83
|
|
|
17
|
|
|
|
|
33
|
|
|
17
|
|
|
|
|
2800
|
|
|
17
|
|
|
|
|
81
|
|
|
17
|
|
|
|
|
33
|
|
|
17
|
|
|
|
|
2682
|
|
|
17
|
|
|
|
|
84
|
|
|
17
|
|
|
|
|
74
|
|
|
17
|
|
|
|
|
2808
|
|
|
17
|
|
|
|
|
304
|
|
|
17
|
|
|
|
|
31
|
|
|
17
|
|
|
|
|
2858
|
|
|
17
|
|
|
|
|
87
|
|
|
17
|
|
|
|
|
26
|
|
|
17
|
|
|
|
|
2887
|
|
|
17
|
|
|
|
|
85
|
|
|
17
|
|
|
|
|
24
|
|
|
17
|
|
|
|
|
3055
|
|
|
17
|
|
|
|
|
85
|
|
|
17
|
|
|
|
|
31
|
|
|
17
|
|
|
|
|
3217
|
|
|
17
|
|
|
|
|
89
|
|
|
17
|
|
|
|
|
25
|
|
|
17
|
|
|
|
|
2843
|
|
|
17
|
|
|
|
|
202
|
|
|
17
|
|
|
|
|
27
|
|
|
17
|
|
|
|
|
2846
|
|
|
17
|
|
|
|
|
115
|
|
|
17
|
|
|
|
|
88
|
|
|
17
|
|
|
|
|
2893
|
|
|
17
|
|
|
|
|
97
|
|
|
17
|
|
|
|
|
28
|
|
|
17
|
|
|
|
|
2145
|
|
|
28
|
|
|
|
|
6775
|
|
|
1
|
|
|
|
|
48
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
14
|
|
|
0
|
|
|
|
|
0
|
|
|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43
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
49
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
13
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
50
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
14
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
43
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
51
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
15
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
71
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
22
|
|
|
0
|
|
|
|
|
0
|
|
78
|
|
|
|
|
|
|
} |
79
|
28
|
|
|
|
|
2641
|
return @exception_classes; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
################################################################################ |
83
|
|
|
|
|
|
|
sub import { |
84
|
28
|
|
|
28
|
|
228
|
my ($class, @tags) = @_; |
85
|
28
|
|
|
|
|
58
|
my %tags; |
86
|
|
|
|
|
|
|
|
87
|
28
|
100
|
|
|
|
160
|
if (@tags) { |
88
|
11
|
|
|
|
|
145
|
my %known_tags = ( |
89
|
|
|
|
|
|
|
'1XX' => ['1XX'], |
90
|
|
|
|
|
|
|
'2XX' => ['2XX'], |
91
|
|
|
|
|
|
|
'3XX' => ['3XX'], |
92
|
|
|
|
|
|
|
'4XX' => ['4XX'], |
93
|
|
|
|
|
|
|
'5XX' => ['5XX'], |
94
|
|
|
|
|
|
|
'REDIRECTION' => ['3XX'], |
95
|
|
|
|
|
|
|
'CLIENT_ERROR' => ['4XX'], |
96
|
|
|
|
|
|
|
'SERVER_ERROR' => ['5XX'], |
97
|
|
|
|
|
|
|
'ERROR' => ['4XX', '5XX'], |
98
|
|
|
|
|
|
|
'ALL' => [qw~1XX 2XX 3XX 4XX 5XX~], |
99
|
|
|
|
|
|
|
); |
100
|
|
|
|
|
|
|
|
101
|
11
|
|
|
|
|
36
|
for my $import_tag (@tags) { |
102
|
12
|
50
|
|
|
|
61
|
next unless ($known_tags{$import_tag}); |
103
|
12
|
|
|
|
|
18
|
$tags{$_} = undef for (@{ $known_tags{$import_tag} }); |
|
12
|
|
|
|
|
99
|
|
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
} else { |
106
|
17
|
|
|
|
|
71
|
@tags{qw~1XX 2XX 3XX 4XX 5XX~} = (); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
28
|
|
|
|
|
26453
|
require Exception::Class; |
110
|
28
|
|
|
|
|
57297
|
Exception::Class->import( |
111
|
|
|
|
|
|
|
'HTTP::Exception' => { isa => 'HTTP::Exception::Base' }, |
112
|
|
|
|
|
|
|
_make_exceptions(%tags) |
113
|
|
|
|
|
|
|
); |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
1; |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 NAME |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
HTTP::Exception::Loader - Creates HTTP::Exception subclasses |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 VERSION |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
version 0.04006 |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 DESCRIPTION |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
This Class Creates all L subclasses. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
DON'T USE THIS PACKAGE DIRECTLY. 'use HTTP::Exception' does this for you. |
133
|
|
|
|
|
|
|
This Package does its job as soon as you call 'use HTTP::Exception'. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
Please refer to the Documentation of L. |
136
|
|
|
|
|
|
|
The Naming Scheme of all subclasses created, as well as the caveats can |
137
|
|
|
|
|
|
|
be found there. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head1 AUTHOR |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Thomas Mueller, C<< >> |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head1 BUGS |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
146
|
|
|
|
|
|
|
C, or through the web interface at |
147
|
|
|
|
|
|
|
L. |
148
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
149
|
|
|
|
|
|
|
your bug as I make changes. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head1 SUPPORT |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
perldoc HTTP::Exception::Base |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
You can also look for information at: |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=over 4 |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
L |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
L |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=item * CPAN Ratings |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
L |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=item * Search CPAN |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
L |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=back |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
Copyright 2010 Thomas Mueller. |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
184
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
185
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=cut |