~ubuntu-branches/debian/sid/libembperl-perl/sid

« back to all changes in this revision

Viewing changes to test/html/opmask/opmask.htm

  • Committer: Bazaar Package Importer
  • Author(s): Angus Lees
  • Date: 2004-02-15 14:23:39 UTC
  • Revision ID: james.westby@ubuntu.com-20040215142339-n21gqf7mx9tmyb8d
Tags: upstream-2.0b10
ImportĀ upstreamĀ versionĀ 2.0b10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
<html>
 
3
<head>
 
4
<title>Some Plain tests Embperl</title>
 
5
</head>
 
6
 
 
7
<body>
 
8
 
 
9
Here it starts with some HTML Text<P>
 
10
 
 
11
All values should be undefined:
 
12
 
 
13
$a = [+ $a +] <BR>
 
14
$b = [+ $b +] <BR>
 
15
$c = [+ $c +] <BR>
 
16
$d = [+ $d +] <BR>
 
17
$e = [+ $e +] <BR>
 
18
 
 
19
 
 
20
First of all assign a value:
 
21
[- $a = '(this is the value in $a)' -] <BR>
 
22
 
 
23
Now we have some 'Umlaute':
 
24
 
 
25
 
 
26
[- $b = "$a &auml;&ouml;&uuml;" -]
 
27
 
 
28
Now lets look what we are getting from this:<BR>
 
29
[+ $a +] [+ $b +]<BR>
 
30
 
 
31
And now a and b together: [+ "$a$b" +]<P>
 
32
 
 
33
Here we have some HTML tags within the perl code, Embperl will delete them!<BR>
 
34
 
 
35
[+ $c = <BR> 6 + 17 <font size="3"> * 3 +]
 
36
 
 
37
Embperl will also translate HMTL escapes to the right characters i.e. $a &amp;lt; 6 will get the perl expression $a &lt; 6: <BR>
 
38
 
 
39
[- $e = 2 -]
 
40
[+ $d = $e &lt; 6 +]
 
41
 
 
42
Now they should have a value
 
43
 
 
44
$a = [+ $a +] <BR>
 
45
$b = [+ $b +] <BR>
 
46
$c = [+ $c +] <BR>
 
47
$d = [+ $d +] <BR>
 
48
$e = [+ $e +] <BR>
 
49
 
 
50
[- $a = 1; $b = 0; $c = 5; $d = 'txt' -]
 
51
 
 
52
 
 
53
[$if $a$]
 
54
    a <br>
 
55
[$ endif$]
 
56
 
 
57
 
 
58
[$if $a $]
 
59
    a <br>
 
60
[$else$]
 
61
    not a<br>
 
62
[$ endif $]
 
63
 
 
64
 
 
65
[$ if $a$]
 
66
    a <br>
 
67
    [$if $b == 0$]
 
68
        b is null <br>
 
69
    [$else$]    
 
70
        b is not null <br>
 
71
    [$endif$]
 
72
[$ else$]
 
73
    not a<br>
 
74
[$ endif $]
 
75
 
 
76
 
 
77
[$ if $a$]
 
78
    a <br>
 
79
    [$if $b == 0$]
 
80
        b is null <br>
 
81
    [$else$]    
 
82
        b is not null <br>
 
83
    [$endif$]
 
84
[$ else$]
 
85
    not a<br>
 
86
    [$if $b == 0$]
 
87
        b is null <br>
 
88
    [$else$]    
 
89
        b is not null <br>
 
90
    [$endif$]
 
91
[$ endif $]
 
92
 
 
93
 
 
94
[$ if !$a$]
 
95
    not a <br>
 
96
    [$if $b == 0$]
 
97
        b is null <br>
 
98
    [$else$]    
 
99
        b is not null <br>
 
100
    [$endif$]
 
101
[$ else$]
 
102
    a<br>
 
103
    [$if $b == 0$]
 
104
        b is null <br>
 
105
    [$else$]    
 
106
        b is not null <br>
 
107
    [$endif$]
 
108
[$ endif $]
 
109
 
 
110
 
 
111
[- $i = 0 -]
 
112
[$ while $i &lt;= $#ffld $]
 
113
    [+ $ffld[$i] +] = [+ $fdat{$ffld[$i]} +]
 
114
    [- $j = 0 -]
 
115
    [$ while $j &lt;= $i $]
 
116
        [+ $j++ +] 
 
117
    [$ endwhile $]
 
118
    <BR>
 
119
    [- $i++ -]
 
120
[$ endwhile $]
 
121
 
 
122
 
 
123
 
 
124
<table>
 
125
    <tr>
 
126
        <td>[+ $c[$row][$col] +] </td>
 
127
    </tr> 
 
128
</table>
 
129
 
 
130
 
 
131
<p> $tabmode = default <p>
 
132
 
 
133
<hr><p>Display an two dimensional array with one, two and three columns !<BR>
 
134
Please take a look at the source in your browser to see the difference<BR>
 
135
 
 
136
[-
 
137
   undef @a ;
 
138
   undef @b ;
 
139
 
 
140
   $a[0][0] = 'a1/1' ;
 
141
   $a[1][0] = 'a2/1' ;
 
142
   $a[1][1] = 'a2/2' ;
 
143
   $a[2][0] = 'a3/1' ;
 
144
   $a[2][1] = 'a3/2' ;
 
145
   $a[2][2] = 'a3/3' ;
 
146
 
 
147
   $b[0][0] = 'b1/1' ;
 
148
   $b[1][0] = 'b2/1' ;
 
149
   $b[1][1] = 'b2/2' ;
 
150
   $b[2][0] = 'b3/1' ;
 
151
   $b[2][1] = 'b3/2' ;
 
152
   $b[2][2] = 'b3/3' ;
 
153
 
 
154
   $maxcol=99 ;
 
155
-]
 
156
   $a[0][[0] = '1/1' ;<BR>
 
157
   $a[1][[0] = '2/1' ;<BR>
 
158
   $a[1][[1] = '2/2' ;<BR>
 
159
   $a[2][[0] = '3/1' ;<BR>
 
160
   $a[2][[1] = '3/2' ;<BR>
 
161
   $a[2][[2] = '3/3' ;<BR>
 
162
 
 
163
<P>$tabmode = default <P>
 
164
 
 
165
<table border="2" width="100%">
 
166
    <tr>
 
167
        <td>[+ $a[$row][$col] +] </td>
 
168
    </tr> 
 
169
</table>
 
170
 
 
171
<table border="2" width="100%">
 
172
    <tr>
 
173
        <th>1</th>
 
174
        <th>2</th>
 
175
        <th>3</th>
 
176
    </tr> 
 
177
    <tr>
 
178
        <td>[+ $a[$row][$col] +] </td>
 
179
    </tr> 
 
180
</table>
 
181
 
 
182
<table border="2" width="100%">
 
183
    <tr>
 
184
        <th>[+ $b[2][$col] +]</th>
 
185
    </tr> 
 
186
    <tr>
 
187
        <td>[+ $a[$row][$col] +] </td>
 
188
    </tr> 
 
189
</table>
 
190
 
 
191
<table>
 
192
    <tr>
 
193
        <td>
 
194
            <table>
 
195
                <tr>
 
196
                    <td>[+ $b[$row][$col] +] </td>
 
197
                </tr> 
 
198
            </table>
 
199
 
 
200
        [+ $a[$row][$col] +] </td>
 
201
    </tr> 
 
202
</table>
 
203
 
 
204
    Shared data: [+ $testshare +] <br>
 
205
Not Shared data: [+ $testshareX +] <br>
 
206
 
 
207
<P>[+ $HTML::Embperl::VERSION +]<P>
 
208
 
 
209
<P>[+ $tabmode +]<P>
 
210
<P>[+ local $tabmode = 1 +]<P>
 
211
 
 
212
<P>
 
213
 
 
214
</body>
 
215
</html>