line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Application::Emulate::PSGI; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26
|
use 5.008; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
6
|
1
|
|
|
1
|
|
5460
|
use CGI; |
|
1
|
|
|
|
|
14620
|
|
|
1
|
|
|
|
|
8
|
|
7
|
1
|
|
|
1
|
|
971
|
use CGI::Emulate::PSGI; |
|
1
|
|
|
|
|
51200
|
|
|
1
|
|
|
|
|
30
|
|
8
|
1
|
|
|
1
|
|
27
|
use CGI::Parse::PSGI; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
161
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub handler { |
13
|
1
|
|
|
1
|
0
|
8
|
my ($class, $code,) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
return sub { |
16
|
1
|
|
|
1
|
|
22738
|
my $env = shift; |
17
|
1
|
|
|
|
|
3
|
my $output = do { |
18
|
1
|
|
|
|
|
18
|
local %ENV = ( |
19
|
|
|
|
|
|
|
%ENV, |
20
|
|
|
|
|
|
|
CGI::Emulate::PSGI->emulate_environment($env), |
21
|
|
|
|
|
|
|
CGI_APP_RETURN_ONLY => 1, |
22
|
|
|
|
|
|
|
); |
23
|
1
|
|
|
|
|
193
|
local *STDIN = $env->{'psgi.input'}; |
24
|
1
|
|
|
|
|
3
|
local *STDERR = $env->{'psgi.errors'}; |
25
|
1
|
|
|
|
|
5
|
CGI::initialize_globals(); |
26
|
1
|
|
|
|
|
23
|
$code->(); |
27
|
|
|
|
|
|
|
}; |
28
|
1
|
|
|
|
|
5900
|
return CGI::Parse::PSGI::parse_cgi_output(\$output); |
29
|
1
|
|
|
|
|
9
|
}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
__END__ |