line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Exception::Loader; |
2
|
|
|
|
|
|
|
$HTTP::Exception::Loader::VERSION = '0.04007'; |
3
|
28
|
|
|
28
|
|
140
|
use strict; |
|
28
|
|
|
|
|
44
|
|
|
28
|
|
|
|
|
725
|
|
4
|
28
|
|
|
28
|
|
103
|
use warnings; |
|
28
|
|
|
|
|
44
|
|
|
28
|
|
|
|
|
585
|
|
5
|
28
|
|
|
28
|
|
96
|
use warnings; |
|
28
|
|
|
|
|
48
|
|
|
28
|
|
|
|
|
632
|
|
6
|
|
|
|
|
|
|
|
7
|
28
|
|
|
28
|
|
7391
|
use HTTP::Exception::Base; |
|
28
|
|
|
|
|
57
|
|
|
28
|
|
|
|
|
702
|
|
8
|
28
|
|
|
28
|
|
8438
|
use HTTP::Exception::1XX; |
|
28
|
|
|
|
|
52
|
|
|
28
|
|
|
|
|
705
|
|
9
|
28
|
|
|
28
|
|
7954
|
use HTTP::Exception::2XX; |
|
28
|
|
|
|
|
45
|
|
|
28
|
|
|
|
|
645
|
|
10
|
28
|
|
|
28
|
|
8327
|
use HTTP::Exception::3XX; |
|
28
|
|
|
|
|
52
|
|
|
28
|
|
|
|
|
649
|
|
11
|
28
|
|
|
28
|
|
7902
|
use HTTP::Exception::4XX; |
|
28
|
|
|
|
|
50
|
|
|
28
|
|
|
|
|
646
|
|
12
|
28
|
|
|
28
|
|
7710
|
use HTTP::Exception::5XX; |
|
28
|
|
|
|
|
56
|
|
|
28
|
|
|
|
|
633
|
|
13
|
28
|
|
|
28
|
|
123
|
use HTTP::Status; |
|
28
|
|
|
|
|
39
|
|
|
28
|
|
|
|
|
5374
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
################################################################################ |
16
|
|
|
|
|
|
|
# little bit messy, but solid |
17
|
|
|
|
|
|
|
# - first create packages for Exception::Class, so it can create them on its own |
18
|
|
|
|
|
|
|
# - then extend those packages by putting methods into the same namespace |
19
|
|
|
|
|
|
|
sub _make_exceptions { |
20
|
28
|
|
|
28
|
|
86
|
my %tags = @_; |
21
|
28
|
|
|
|
|
55
|
my (@http_statuses, @exception_classes); |
22
|
|
|
|
|
|
|
{ |
23
|
28
|
|
|
28
|
|
154
|
no strict 'refs'; |
|
28
|
|
|
|
|
39
|
|
|
28
|
|
|
|
|
5008
|
|
|
28
|
|
|
|
|
39
|
|
24
|
28
|
|
|
|
|
36
|
@http_statuses = grep { /^HTTP_/ } (keys %{"HTTP::Status::"}); |
|
4088
|
|
|
|
|
5150
|
|
|
28
|
|
|
|
|
469
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
28
|
|
|
|
|
129
|
my $code = ''; |
28
|
28
|
|
|
|
|
61
|
for my $http_status (@http_statuses) { |
29
|
1792
|
|
|
|
|
3204
|
my $statuscode = HTTP::Status->$http_status; |
30
|
1792
|
|
|
|
|
2299
|
my $http_status_message = HTTP::Status::status_message($statuscode); |
31
|
1792
|
|
|
|
|
4241
|
my $statuscode_range = $statuscode; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# remove HTTP_ for exception classname |
34
|
1792
|
|
|
|
|
3561
|
$http_status =~ s/^HTTP_//; |
35
|
|
|
|
|
|
|
# replace the last 2 digits with XX for basename creation |
36
|
1792
|
|
|
|
|
3288
|
$statuscode_range =~ s/\d{2}$/XX/; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# only create requested classes |
39
|
1792
|
100
|
|
|
|
2918
|
next unless (exists $tags{$statuscode_range}); |
40
|
|
|
|
|
|
|
|
41
|
1358
|
|
|
|
|
1964
|
my $package_name_code = 'HTTP::Exception::'.$statuscode; |
42
|
1358
|
|
|
|
|
1709
|
my $package_name_base = 'HTTP::Exception::'.$statuscode_range; |
43
|
1358
|
|
|
|
|
1670
|
my $package_name_message = 'HTTP::Exception::'.$http_status; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# create a Package like HTTP::Exception::404, |
46
|
|
|
|
|
|
|
# but also a Package HTTP::Exception::NOT_FOUND, |
47
|
|
|
|
|
|
|
# which inherits from HTTP::Exception::404 |
48
|
|
|
|
|
|
|
# HTTP::Exception::404 inherits from HTTP::Exception::4XX |
49
|
1358
|
|
|
|
|
2981
|
push @exception_classes, |
50
|
|
|
|
|
|
|
$package_name_code => {isa => $package_name_base}, |
51
|
|
|
|
|
|
|
$package_name_message => {isa => $package_name_code}; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# TODO check whether evaled subs with a ()-prototype are compiled to constants |
54
|
1358
|
|
|
|
|
5039
|
$code .= qq~ |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
package $package_name_code; |
57
|
|
|
|
|
|
|
sub code () { $statuscode } |
58
|
|
|
|
|
|
|
sub _status_message () { q{$http_status_message} } |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
package $package_name_message; |
61
|
|
|
|
|
|
|
use Scalar::Util qw(blessed); |
62
|
|
|
|
|
|
|
sub caught { |
63
|
|
|
|
|
|
|
my \$self = shift; |
64
|
|
|
|
|
|
|
my \$e = \$@; |
65
|
|
|
|
|
|
|
return \$e if (blessed \$e && \$e->isa('$package_name_code')); |
66
|
|
|
|
|
|
|
\$self->SUPER::caught(\@_); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
~; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# RT https://rt.cpan.org/Ticket/Display.html?id=79021 |
73
|
|
|
|
|
|
|
# silence warnings about "subroutine redefined" in a mod_perl environment |
74
|
|
|
|
|
|
|
{ |
75
|
28
|
|
|
28
|
|
171
|
no warnings 'redefine'; |
|
28
|
|
|
|
|
60
|
|
|
28
|
|
|
|
|
5993
|
|
|
28
|
|
|
|
|
57
|
|
76
|
28
|
50
|
33
|
28
|
0
|
154
|
eval $code; |
|
28
|
50
|
33
|
28
|
0
|
54
|
|
|
28
|
50
|
33
|
28
|
0
|
3671
|
|
|
28
|
50
|
33
|
28
|
0
|
157
|
|
|
28
|
50
|
33
|
27
|
0
|
69
|
|
|
28
|
50
|
33
|
27
|
0
|
3442
|
|
|
28
|
50
|
33
|
27
|
0
|
147
|
|
|
28
|
50
|
33
|
27
|
0
|
45
|
|
|
28
|
50
|
33
|
25
|
0
|
3436
|
|
|
28
|
50
|
33
|
25
|
0
|
153
|
|
|
28
|
50
|
33
|
24
|
0
|
36
|
|
|
28
|
50
|
33
|
24
|
0
|
3228
|
|
|
27
|
50
|
33
|
22
|
0
|
143
|
|
|
27
|
50
|
33
|
22
|
0
|
40
|
|
|
27
|
50
|
33
|
22
|
0
|
3045
|
|
|
27
|
50
|
33
|
22
|
0
|
161
|
|
|
27
|
50
|
33
|
22
|
0
|
37
|
|
|
27
|
50
|
33
|
22
|
0
|
3057
|
|
|
27
|
50
|
33
|
22
|
0
|
155
|
|
|
27
|
50
|
33
|
22
|
0
|
37
|
|
|
27
|
50
|
33
|
22
|
0
|
2936
|
|
|
27
|
50
|
33
|
22
|
0
|
138
|
|
|
27
|
50
|
33
|
22
|
0
|
46
|
|
|
27
|
50
|
33
|
22
|
0
|
2843
|
|
|
25
|
50
|
33
|
22
|
0
|
126
|
|
|
25
|
50
|
33
|
22
|
0
|
33
|
|
|
25
|
50
|
33
|
22
|
0
|
2721
|
|
|
25
|
50
|
33
|
22
|
0
|
124
|
|
|
25
|
50
|
33
|
22
|
0
|
35
|
|
|
25
|
50
|
33
|
22
|
0
|
2624
|
|
|
24
|
50
|
33
|
20
|
0
|
114
|
|
|
24
|
50
|
33
|
20
|
0
|
41
|
|
|
24
|
50
|
33
|
20
|
0
|
2627
|
|
|
24
|
50
|
33
|
20
|
0
|
118
|
|
|
24
|
100
|
66
|
20
|
0
|
37
|
|
|
24
|
50
|
33
|
20
|
0
|
2399
|
|
|
22
|
50
|
33
|
20
|
0
|
107
|
|
|
22
|
50
|
33
|
20
|
0
|
33
|
|
|
22
|
50
|
33
|
20
|
0
|
2260
|
|
|
22
|
50
|
33
|
20
|
0
|
181
|
|
|
22
|
50
|
33
|
20
|
0
|
36
|
|
|
22
|
50
|
33
|
20
|
0
|
2407
|
|
|
22
|
50
|
33
|
19
|
0
|
111
|
|
|
22
|
50
|
33
|
19
|
0
|
247
|
|
|
22
|
50
|
33
|
19
|
0
|
2464
|
|
|
22
|
50
|
33
|
19
|
0
|
108
|
|
|
22
|
50
|
33
|
19
|
0
|
38
|
|
|
22
|
50
|
33
|
19
|
0
|
2499
|
|
|
22
|
50
|
33
|
19
|
0
|
111
|
|
|
22
|
50
|
33
|
19
|
0
|
29
|
|
|
22
|
50
|
33
|
18
|
0
|
2522
|
|
|
22
|
50
|
33
|
18
|
0
|
112
|
|
|
22
|
50
|
33
|
17
|
0
|
40
|
|
|
22
|
50
|
33
|
17
|
0
|
2292
|
|
|
22
|
50
|
33
|
17
|
0
|
107
|
|
|
22
|
50
|
33
|
17
|
0
|
32
|
|
|
22
|
50
|
33
|
17
|
0
|
2394
|
|
|
22
|
50
|
33
|
17
|
0
|
111
|
|
|
22
|
50
|
33
|
17
|
0
|
28
|
|
|
22
|
50
|
33
|
17
|
0
|
2222
|
|
|
22
|
50
|
33
|
17
|
0
|
102
|
|
|
22
|
50
|
33
|
17
|
0
|
29
|
|
|
22
|
50
|
33
|
17
|
0
|
2580
|
|
|
22
|
50
|
33
|
17
|
0
|
111
|
|
|
22
|
|
|
1
|
|
33
|
|
|
22
|
|
|
1
|
|
2482
|
|
|
22
|
|
|
1
|
|
107
|
|
|
22
|
|
|
1
|
|
35
|
|
|
22
|
|
|
1
|
|
2325
|
|
|
22
|
|
|
4
|
|
127
|
|
|
22
|
|
|
1
|
|
29
|
|
|
22
|
|
|
1
|
|
2462
|
|
|
22
|
|
|
2
|
|
109
|
|
|
22
|
|
|
1
|
|
29
|
|
|
22
|
|
|
1
|
|
2290
|
|
|
22
|
|
|
1
|
|
102
|
|
|
22
|
|
|
1
|
|
35
|
|
|
22
|
|
|
8
|
|
2249
|
|
|
22
|
|
|
1
|
|
114
|
|
|
22
|
|
|
1
|
|
31
|
|
|
22
|
|
|
1
|
|
2401
|
|
|
22
|
|
|
1
|
|
106
|
|
|
22
|
|
|
1
|
|
29
|
|
|
22
|
|
|
1
|
|
2239
|
|
|
22
|
|
|
1
|
|
106
|
|
|
22
|
|
|
1
|
|
29
|
|
|
22
|
|
|
1
|
|
2316
|
|
|
22
|
|
|
1
|
|
106
|
|
|
22
|
|
|
1
|
|
36
|
|
|
22
|
|
|
1
|
|
2081
|
|
|
20
|
|
|
1
|
|
103
|
|
|
20
|
|
|
1
|
|
49
|
|
|
20
|
|
|
1
|
|
2142
|
|
|
20
|
|
|
1
|
|
104
|
|
|
20
|
|
|
1
|
|
30
|
|
|
20
|
|
|
1
|
|
2186
|
|
|
20
|
|
|
1
|
|
110
|
|
|
20
|
|
|
1
|
|
45
|
|
|
20
|
|
|
4
|
|
2084
|
|
|
20
|
|
|
1
|
|
108
|
|
|
20
|
|
|
1
|
|
26
|
|
|
20
|
|
|
1
|
|
2254
|
|
|
20
|
|
|
1
|
|
99
|
|
|
20
|
|
|
1
|
|
27
|
|
|
20
|
|
|
1
|
|
2220
|
|
|
20
|
|
|
1
|
|
94
|
|
|
20
|
|
|
1
|
|
31
|
|
|
20
|
|
|
1
|
|
1967
|
|
|
20
|
|
|
1
|
|
95
|
|
|
20
|
|
|
1
|
|
34
|
|
|
20
|
|
|
1
|
|
2159
|
|
|
20
|
|
|
1
|
|
93
|
|
|
20
|
|
|
1
|
|
35
|
|
|
20
|
|
|
1
|
|
1958
|
|
|
20
|
|
|
1
|
|
94
|
|
|
20
|
|
|
1
|
|
43
|
|
|
20
|
|
|
1
|
|
1998
|
|
|
20
|
|
|
1
|
|
99
|
|
|
20
|
|
|
1
|
|
30
|
|
|
20
|
|
|
1
|
|
2212
|
|
|
20
|
|
|
1
|
|
95
|
|
|
20
|
|
|
1
|
|
30
|
|
|
20
|
|
|
1
|
|
2312
|
|
|
20
|
|
|
1
|
|
99
|
|
|
20
|
|
|
1
|
|
29
|
|
|
20
|
|
|
1
|
|
2029
|
|
|
19
|
|
|
1
|
|
96
|
|
|
19
|
|
|
1
|
|
28
|
|
|
19
|
|
|
|
|
2100
|
|
|
19
|
|
|
|
|
94
|
|
|
19
|
|
|
|
|
30
|
|
|
19
|
|
|
|
|
1975
|
|
|
19
|
|
|
|
|
94
|
|
|
19
|
|
|
|
|
23
|
|
|
19
|
|
|
|
|
2002
|
|
|
19
|
|
|
|
|
90
|
|
|
19
|
|
|
|
|
26
|
|
|
19
|
|
|
|
|
2054
|
|
|
19
|
|
|
|
|
94
|
|
|
19
|
|
|
|
|
33
|
|
|
19
|
|
|
|
|
2020
|
|
|
19
|
|
|
|
|
97
|
|
|
19
|
|
|
|
|
27
|
|
|
19
|
|
|
|
|
1947
|
|
|
19
|
|
|
|
|
90
|
|
|
19
|
|
|
|
|
28
|
|
|
19
|
|
|
|
|
1896
|
|
|
19
|
|
|
|
|
96
|
|
|
19
|
|
|
|
|
26
|
|
|
19
|
|
|
|
|
2075
|
|
|
18
|
|
|
|
|
86
|
|
|
18
|
|
|
|
|
25
|
|
|
18
|
|
|
|
|
1887
|
|
|
18
|
|
|
|
|
99
|
|
|
18
|
|
|
|
|
23
|
|
|
18
|
|
|
|
|
1935
|
|
|
17
|
|
|
|
|
86
|
|
|
17
|
|
|
|
|
25
|
|
|
17
|
|
|
|
|
1912
|
|
|
17
|
|
|
|
|
89
|
|
|
17
|
|
|
|
|
33
|
|
|
17
|
|
|
|
|
1814
|
|
|
17
|
|
|
|
|
89
|
|
|
17
|
|
|
|
|
25
|
|
|
17
|
|
|
|
|
1796
|
|
|
17
|
|
|
|
|
83
|
|
|
17
|
|
|
|
|
28
|
|
|
17
|
|
|
|
|
1720
|
|
|
17
|
|
|
|
|
96
|
|
|
17
|
|
|
|
|
34
|
|
|
17
|
|
|
|
|
1938
|
|
|
17
|
|
|
|
|
96
|
|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|
|
12
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
35
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
11
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
32
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
34
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
33
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
12
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
36
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
0
|
|
|
|
|
0
|
|
77
|
28
|
50
|
|
|
|
443
|
die "HTTP::Exception::Loader error: $@\n$code\n" if $@; |
78
|
|
|
|
|
|
|
} |
79
|
28
|
|
|
|
|
792
|
return @exception_classes; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
################################################################################ |
83
|
|
|
|
|
|
|
sub import { |
84
|
28
|
|
|
28
|
|
68
|
my ($class, @tags) = @_; |
85
|
28
|
|
|
|
|
36
|
my %tags; |
86
|
|
|
|
|
|
|
|
87
|
28
|
100
|
|
|
|
80
|
if (@tags) { |
88
|
11
|
|
|
|
|
82
|
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
|
|
|
|
|
24
|
for my $import_tag (@tags) { |
102
|
12
|
50
|
|
|
|
35
|
next unless ($known_tags{$import_tag}); |
103
|
12
|
|
|
|
|
12
|
$tags{$_} = undef for (@{ $known_tags{$import_tag} }); |
|
12
|
|
|
|
|
58
|
|
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
} else { |
106
|
17
|
|
|
|
|
45
|
@tags{qw~1XX 2XX 3XX 4XX 5XX~} = (); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
28
|
|
|
|
|
9621
|
require Exception::Class; |
110
|
28
|
|
|
|
|
30399
|
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.04007 |
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 |