Debian Codegraph @

test/cmp/include.htm

raw
1
2 <html>
3 <head>
4 <title>Embperl Tests - Include other Embperl pages via Execute</title>
5 </head>
6
7 <h1>Embperl Tests - Include other Embperl pages via Execute</h1>
8
9
10 <H1> 1.) Include from memory</H1>
11
12 <P>Here is some text</P>
13 <H1> 2.) Include from memory with some Embperl code</H1>
14
15 <table><tr><td>a1</td> <td>b2</td> <td>c3</td> </tr> </table> </P>
16 <H1> 3.) Include from memory with passing of variables</H1>
17
18
19 <P>Transfer some vars Some Var !</P>
20 <H1> 4.) Change the variable, but not the code</H1>
21
22 <P>Transfer some vars Do it again !</P>
23 <H1> 5a.) Use method -> param to pass parameters</H1>
24
25
26 <P>Use method -> param to transfer some data (1 2 3 4) !</P>
27 <H1> 5.) Use \@param to pass parameters</H1>
28
29
30 <P>Use @param to transfer some data (1 2 3 4) !</P>
31 <H1> 6.) Use \@param to pass parameters and return it</H1>
32
33 <H3> $p[0] is vara and $p[1] is varb<H3>
34
35 <P>Got data in @param (vara varb) !</P><P>Change data in @param to (newA newB) !</P>
36 <H3> $p[0] is now newA and $p[1] is now newB <H3>
37
38 <H1> 7.) Presetup \%fdat and \@ffld</H1>
39
40 <P><table><tr><td>fdat</td><td>text</td></tr><tr><td>test</td><td>value</td></tr></table></P>
41 <H1> 7a.) Presetup my \%fdat and my \@ffld</H1>
42
43 <P><table><tr><td>fdat1</td><td>text1</td></tr><tr><td>test1</td><td>value1</td></tr></table></P>
44 <H1> 7b.) Presetup \%fdat</H1>
45
46 ^<P><table><tr><td>(fdat2<\/td><td>text2<\/td><\/tr><tr><td>test2<\/td><td>value2|test2<\/td><td>value2<\/td><\/tr><tr><td>fdat2<\/td><td>text2)<\/td><\/tr><\/table><\/P>
47 <H1> 7c.) Presetup \@ffld</H1>
48
49 <P><table></table></P> @ffld = fdat3 test3
50 <H1> 8a.) Include a file</H1>
51
52
53 Here it starts with some HTML Text<P>
54
55 All values should be undefined at the first include and
56 apear at the second include:
57 <P>
58
59 $a = <BR>
60 $b = <BR>
61 $c = <BR>
62 $d = <BR>
63 $e = <BR>
64
65
66 First of all assign a value:
67 <BR>
68
69 Now we have some 'Umlaute':
70
71
72 Now lets look what we are getting from this:<BR>
73 (this is the value in $a) (this is the value in $a) &auml;&ouml;&uuml;<BR>
74
75 And now a and b together: (this is the value in $a)(this is the value in $a) &auml;&ouml;&uuml;<P>
76
77 Here we have some HTML tags within the perl code, Embperl will delete them!<BR>
78
79 57
80 SELECT * FROM a ORDER BY b USING &lt;; Hi There&gt;
81 Here we have something which looks like a HTML tag, but does not start with<br>
82 a character, Embperl does not change them!<BR>
83
84 SELECT * FROM a ORDER BY b USING &lt;; Hi There&gt;
85 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>
86
87 1
88 Now they should have a value
89
90 $a = (this is the value in $a) <BR>
91 $b = (this is the value in $a) &auml;&ouml;&uuml; <BR>
92 $c = 57 <BR>
93 $d = 1 <BR>
94 $e = 2 <BR>
95
96 <P>Ok.<P>
97
98
99 <H1> 8b.) Include again the same file </H1>
100
101
102 Here it starts with some HTML Text<P>
103
104 All values should be undefined at the first include and
105 apear at the second include:
106 <P>
107
108 $a = (this is the value in $a) <BR>
109 $b = (this is the value in $a) &auml;&ouml;&uuml; <BR>
110 $c = 57 <BR>
111 $d = 1 <BR>
112 $e = 2 <BR>
113
114
115 First of all assign a value:
116 <BR>
117
118 Now we have some 'Umlaute':
119
120
121 Now lets look what we are getting from this:<BR>
122 (this is the value in $a) (this is the value in $a) &auml;&ouml;&uuml;<BR>
123
124 And now a and b together: (this is the value in $a)(this is the value in $a) &auml;&ouml;&uuml;<P>
125
126 Here we have some HTML tags within the perl code, Embperl will delete them!<BR>
127
128 57
129 SELECT * FROM a ORDER BY b USING &lt;; Hi There&gt;
130 Here we have something which looks like a HTML tag, but does not start with<br>
131 a character, Embperl does not change them!<BR>
132
133 SELECT * FROM a ORDER BY b USING &lt;; Hi There&gt;
134 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>
135
136 1
137 Now they should have a value
138
139 $a = (this is the value in $a) <BR>
140 $b = (this is the value in $a) &auml;&ouml;&uuml; <BR>
141 $c = 57 <BR>
142 $d = 1 <BR>
143 $e = 2 <BR>
144
145 <P>Ok.<P>
146
147
148 <H1> 9.) Include a file and return output in a scalar</H1>
149
150
151
152 <H3>
153 Here it starts with some HTML Text&lt;P&gt;
154
155 All values should be undefined at the first include and
156 apear at the second include:
157 &lt;P&gt;
158
159 $a = (this is the value in $a) &lt;BR&gt;
160 $b = (this is the value in $a) &amp;auml;&amp;ouml;&amp;uuml; &lt;BR&gt;
161 $c = 57 &lt;BR&gt;
162 $d = 1 &lt;BR&gt;
163 $e = 2 &lt;BR&gt;
164
165
166 First of all assign a value:
167 &lt;BR&gt;
168
169 Now we have some 'Umlaute':
170
171
172 Now lets look what we are getting from this:&lt;BR&gt;
173 (this is the value in $a) (this is the value in $a) &amp;auml;&amp;ouml;&amp;uuml;&lt;BR&gt;
174
175 And now a and b together: (this is the value in $a)(this is the value in $a) &amp;auml;&amp;ouml;&amp;uuml;&lt;P&gt;
176
177 Here we have some HTML tags within the perl code, Embperl will delete them!&lt;BR&gt;
178
179 57
180 SELECT * FROM a ORDER BY b USING &amp;lt;; Hi There&amp;gt;
181 Here we have something which looks like a HTML tag, but does not start with&lt;br&gt;
182 a character, Embperl does not change them!&lt;BR&gt;
183
184 SELECT * FROM a ORDER BY b USING &amp;lt;; Hi There&amp;gt;
185 Embperl will also translate HMTL escapes to the right characters i.e. $a &amp;amp;lt; 6 will get the perl expression $a &amp;lt; 6: &lt;BR&gt;
186
187 1
188 Now they should have a value
189
190 $a = (this is the value in $a) &lt;BR&gt;
191 $b = (this is the value in $a) &amp;auml;&amp;ouml;&amp;uuml; &lt;BR&gt;
192 $c = 57 &lt;BR&gt;
193 $d = 1 &lt;BR&gt;
194 $e = 2 &lt;BR&gt;
195
196 &lt;P&gt;Ok.&lt;P&gt;
197
198
199 </H3>
200
201
202 <H1> 10.) Include inside a table</H1>
203
204 <table>
205 <tr>
206 <td>
207 m1 : Start include
208 <table>
209 <tr>
210 <td>
211 m1 - s1 </td>
212
213 <td>
214 m1 - s2 </td>
215
216 <td>
217 m1 - s3 </td>
218 </tr>
219 </table>
220 Parameters:<BR>
221 <table>
222 <tr>
223 <td>
224 m1 </td>
225
226 <td>
227 main </td>
228 </tr>
229 </table>
230 p0 m1
231 p1 main
232 End include
233
234 </td>
235 </tr>
236
237 <tr>
238 <td>
239 m2 : Start include
240 <table>
241 <tr>
242 <td>
243 m2 - s1 </td>
244
245 <td>
246 m2 - s2 </td>
247
248 <td>
249 m2 - s3 </td>
250 </tr>
251 </table>
252 Parameters:<BR>
253 <table>
254 <tr>
255 <td>
256 m2 </td>
257
258 <td>
259 main </td>
260 </tr>
261 </table>
262 p0 m2
263 p1 main
264 End include
265
266 </td>
267 </tr>
268
269 <tr>
270 <td>
271 m3 : Start include
272 <table>
273 <tr>
274 <td>
275 m3 - s1 </td>
276
277 <td>
278 m3 - s2 </td>
279
280 <td>
281 m3 - s3 </td>
282 </tr>
283 </table>
284 Parameters:<BR>
285 <table>
286 <tr>
287 <td>
288 m3 </td>
289
290 <td>
291 main </td>
292 </tr>
293 </table>
294 p0 m3
295 p1 main
296 End include
297
298 </td>
299 </tr>
300 </table>
301
302
303 <H1> 11.) Include a file with parameters</H1>
304
305 Here is param[0] -> 0<br>
306 Here is param[1] -> B<br>
307 Here is param[2] -> three<br>
308 Here is param[3] -> dddd<br>
309 Here is param[4] -> 555<br>
310
311
312
313 <H1> 12.) Include a file and write outputfile</H1>
314
315 <H1> 12.) Done :-)</H1>
316
317 <br>
318
319
320 <p><hr>
321
322 <small>Embperl (c) 1997-2005 G.Richter</small>
323
324 </body>
325 </html>
326