File: mix.htm

package info (click to toggle)
libembperl-perl 2.5.0-17
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 7,632 kB
  • sloc: ansic: 21,387; perl: 14,497; javascript: 4,280; cpp: 467; xml: 49; makefile: 35; sh: 24
file content (64 lines) | stat: -rwxr-xr-x 958 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

<html>
<head>
<title>Embperl Tests - Mix top level perl, with subroutines and metacommands</title>
</head>

<body>

Here it starts with some HTML Text<P>

All values should be undefined:

[* $a = 'global value' ; *] <BR>

global value: $a = [+ $a || ''  +] <BR>

[* { local $a ; *]

$a = [+ $a || ''  +] <BR>

[* $a = 'lokal value' ; *] <BR>

lokal value: $a = [+ $a || ''  +] <BR>

[* } *]

again global value: $a = [+ $a || ''  +] <BR>

[* @x = (1, 4 ,8, 17) ; *]

[- $i = 0 -]
[$ while $i &lt;= $#x $]
    [+ $i +] = [+ $x[$i] +] <br>
    [* $j = 0 ; *]
    [$ while $j &lt;= $i $]
        [+ $j++ +] 
    [$ endwhile $]
    <BR>
    [* $i++ ; *]
[$ endwhile $]


[-
   undef @b ;

   $b[0][0] = 'b1/1' ;
   $b[1][0] = 'b2/1' ;
   $b[1][1] = 'b2/2' ;
   $b[2][0] = 'b3/1' ;
   $b[2][1] = 'b3/2' ;
   $b[2][2] = 'b3/3' ;

-]

<table>
    <tr>
        <td>[* $i = $row ; *][+ $i +]</td><td>[+ $b[$row][$col] +] </td>
    </tr> 
</table>



</body>
</html>