line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ZM::SSI; |
2
|
|
|
|
|
|
|
$ZM::SSI::VERSION = '0.0.5'; |
3
|
1
|
|
|
1
|
|
430
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
450
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub parse |
6
|
|
|
|
|
|
|
{ |
7
|
0
|
|
|
0
|
1
|
|
my $data = shift; |
8
|
0
|
|
|
|
|
|
$data=~s//${\(include($1))}/gi; |
|
0
|
|
|
|
|
|
|
9
|
0
|
|
|
|
|
|
$data=~s//${\(execcgi($1))}/gi; |
|
0
|
|
|
|
|
|
|
10
|
0
|
|
|
|
|
|
return($data); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub include |
14
|
|
|
|
|
|
|
{ |
15
|
0
|
|
|
0
|
0
|
|
my $file=shift; |
16
|
0
|
0
|
|
|
|
|
$file=$ENV{DOCUMENT_ROOT}.$file if($file=~/^\//); |
17
|
0
|
|
|
|
|
|
my $old; |
18
|
0
|
|
|
|
|
|
$old=$/; |
19
|
0
|
|
|
|
|
|
undef($/); |
20
|
0
|
|
|
|
|
|
open(DATAFOR,$file); |
21
|
0
|
|
|
|
|
|
my $data=; |
22
|
0
|
|
|
|
|
|
close(DATAFOR); |
23
|
0
|
|
|
|
|
|
$/=$old; |
24
|
0
|
|
|
|
|
|
$data=parse($data); |
25
|
0
|
|
|
|
|
|
return($data); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub execcgi |
29
|
|
|
|
|
|
|
{ |
30
|
0
|
|
|
0
|
0
|
|
my $file=shift; |
31
|
0
|
0
|
|
|
|
|
if($file=~/^([^?]*)\?(.*)/) # Cut Query string |
32
|
|
|
|
|
|
|
{ |
33
|
0
|
|
|
|
|
|
$file=$1; |
34
|
0
|
0
|
|
|
|
|
if($ENV{QUERY_STRING} eq '') |
35
|
|
|
|
|
|
|
{ |
36
|
0
|
|
|
|
|
|
$ENV{QUERY_STRING}=$2; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
else |
39
|
|
|
|
|
|
|
{ |
40
|
0
|
|
|
|
|
|
$ENV{QUERY_STRING}.='&'.$2; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
0
|
0
|
|
|
|
|
if($file=~/^\//) |
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
|
|
|
$file=$ENV{DOCUMENT_ROOT}.$file; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
else |
48
|
|
|
|
|
|
|
{ |
49
|
0
|
|
|
|
|
|
$file="./$file"; |
50
|
|
|
|
|
|
|
} |
51
|
0
|
|
|
|
|
|
my $data=`$file`; |
52
|
0
|
|
|
|
|
|
$data=~s/^.*\n\n//; |
53
|
0
|
|
|
|
|
|
$data=parse($data); |
54
|
0
|
|
|
|
|
|
return($data); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
############################# |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |