line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::WTweb; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# WAYCALL TOOL web |
4
|
|
|
|
|
|
|
# 20043112 |
5
|
|
|
|
|
|
|
# Gm Gamboni |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
73817
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
10
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
992
|
|
11
|
|
|
|
|
|
|
$VERSION = 0.01; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new{ |
14
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
15
|
0
|
|
0
|
|
|
|
my $class = ref($self) || $self; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my %VARS = (); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $this = {}; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
$this->{DEBUG} = 0; # 0 debug off != 0 debug on |
22
|
0
|
|
|
|
|
|
$this->{HTMLDIR}; |
23
|
0
|
|
|
|
|
|
$this->{HYPER_PTR}; |
24
|
0
|
|
|
|
|
|
$this->{F_POS}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
bless $this, $class; |
29
|
0
|
|
|
|
|
|
return $this; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub processhtml{ |
34
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
35
|
0
|
|
|
|
|
|
my %params = @_; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $fname = $params{'FileName'}; |
38
|
0
|
|
|
|
|
|
my $prhdr = $params{'Header'}; |
39
|
0
|
0
|
|
|
|
|
if($fname){ |
40
|
0
|
|
|
|
|
|
delete ($params{'FileName'}); |
41
|
|
|
|
|
|
|
}else{ |
42
|
0
|
|
|
|
|
|
die "No filename Given\n"; |
43
|
|
|
|
|
|
|
} |
44
|
0
|
0
|
|
|
|
|
if($prhdr){ |
45
|
0
|
|
|
|
|
|
print "Content-Type: text/html\n\n"; |
46
|
0
|
|
|
|
|
|
delete($params{'Header'}); |
47
|
|
|
|
|
|
|
} |
48
|
0
|
|
|
|
|
|
$this->{F_POS} = $this->fileseek($fname); |
49
|
0
|
|
|
|
|
|
my $alen = $this->{HYPER_PTR}; |
50
|
0
|
|
|
|
|
|
my $acpy = @$alen[$this->{F_POS}]; |
51
|
0
|
|
|
|
|
|
my $ac; |
52
|
|
|
|
|
|
|
my @ary; |
53
|
0
|
|
|
|
|
|
foreach my $lc(@$acpy){ push(@ary, $lc)}; |
|
0
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
shift(@ary); |
55
|
0
|
|
|
|
|
|
foreach $ac(@ary){ |
56
|
0
|
|
|
|
|
|
while((my $key, my $value) = each(%params)){ |
57
|
0
|
|
|
|
|
|
$ac =~ s/$key/$value/g; |
58
|
|
|
|
|
|
|
} |
59
|
0
|
|
|
|
|
|
print $ac; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub fileseek{ |
64
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
65
|
0
|
|
|
|
|
|
my $fts = shift; |
66
|
0
|
|
|
|
|
|
my $cnt = 0; |
67
|
0
|
|
|
|
|
|
my $alen = $this->{HYPER_PTR}; |
68
|
0
|
|
|
|
|
|
foreach my $ar(@$alen){ |
69
|
0
|
0
|
|
|
|
|
return $cnt if(@$ar[0] =~ /$fts/); |
70
|
0
|
|
|
|
|
|
$cnt++ |
71
|
|
|
|
|
|
|
} |
72
|
0
|
|
|
|
|
|
return -1; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub sethtmldir{ |
76
|
0
|
|
|
0
|
0
|
|
my $this= shift; |
77
|
0
|
|
|
|
|
|
my $dir = shift; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# Debug - expression validate input |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
$this->{HTMLDIR} = $dir; |
82
|
0
|
|
|
|
|
|
return 1; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub fileload{ |
86
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
87
|
0
|
|
|
|
|
|
my @filenames = @_; |
88
|
0
|
0
|
|
|
|
|
return -1 unless @filenames; |
89
|
0
|
|
|
|
|
|
my($cnt,@HYPER); |
90
|
0
|
|
|
|
|
|
foreach my $file(@filenames){ |
91
|
0
|
0
|
|
|
|
|
open(FH, "<$this->{HTMLDIR}/$file")or return 0; |
92
|
0
|
|
|
|
|
|
my @lines = ; |
93
|
0
|
|
|
|
|
|
close FH; |
94
|
0
|
|
|
|
|
|
unshift(@lines, $file); |
95
|
0
|
|
|
|
|
|
$HYPER[$cnt] = \@lines, |
96
|
|
|
|
|
|
|
$cnt++; |
97
|
|
|
|
|
|
|
} |
98
|
0
|
|
|
|
|
|
$this->{HYPER_PTR}= \@HYPER; |
99
|
0
|
|
|
|
|
|
return 1; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
# NOT IMPLEMENTED YET # |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub prv_parse{ |
105
|
0
|
|
|
0
|
0
|
|
my @line = @_; |
106
|
0
|
|
|
|
|
|
print "INIT--------------------\n"; |
107
|
0
|
|
|
|
|
|
foreach my $l(@line){ |
108
|
0
|
|
|
|
|
|
print "$l"; |
109
|
0
|
0
|
|
|
|
|
if($l =~ /(_\w+_)/){ |
110
|
0
|
|
|
|
|
|
print "Var: $1\n"; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
} |
113
|
0
|
|
|
|
|
|
print "END--------------------\n"; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
1; |
119
|
|
|
|
|
|
|
__END__ |