line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Application::Plugin::Redirect; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
23363
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
49
|
|
4
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION @EXPORT); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
268
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
$VERSION = '1.00'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
@EXPORT = qw( |
11
|
|
|
|
|
|
|
redirect |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
18689
|
sub import { goto &Exporter::import } |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub redirect { |
17
|
3
|
|
|
3
|
1
|
85424
|
my $self = shift; |
18
|
3
|
|
|
|
|
8
|
my $location = shift; |
19
|
3
|
|
|
|
|
7
|
my $status = shift; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# The eval may fail, but we don't care |
22
|
3
|
|
|
|
|
7
|
eval { |
23
|
3
|
|
|
1
|
|
23
|
$self->run_modes( dummy_redirect => sub { } ); |
|
1
|
|
|
|
|
57
|
|
24
|
3
|
|
|
|
|
65
|
$self->prerun_mode('dummy_redirect'); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
3
|
100
|
|
|
|
1945
|
if ($status) { |
28
|
1
|
|
|
|
|
8
|
$self->header_add( -location => $location, -status => $status ); |
29
|
|
|
|
|
|
|
} else { |
30
|
2
|
|
|
|
|
21
|
$self->header_add( -location => $location ); |
31
|
|
|
|
|
|
|
} |
32
|
3
|
|
|
|
|
161
|
$self->header_type('redirect'); |
33
|
3
|
|
|
|
|
51
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |