| 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 äöü" -] |
| 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 &lt; 6 will get the perl expression $a < 6: <BR> |
| 38 |
|
| 39 |
[- $e = 2 -] |
| 40 |
[+ $d = $e < 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 <= $#ffld $] |
| 113 |
[+ $ffld[$i] +] = [+ $fdat{$ffld[$i]} +] |
| 114 |
[- $j = 0 -] |
| 115 |
[$ while $j <= $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 |
<td>[+ $a[$row][$col] +] </td> |
| 174 |
</tr> |
| 175 |
</table> |
| 176 |
|
| 177 |
<table border="2" width="100%"> |
| 178 |
<tr> |
| 179 |
<td>[+ $a[$row][$col] +] </td> |
| 180 |
</tr> |
| 181 |
</table> |
| 182 |
|
| 183 |
<table> |
| 184 |
<tr> |
| 185 |
<td> |
| 186 |
<table> |
| 187 |
<tr> |
| 188 |
<td>[+ $b[$row][$col] +] </td> |
| 189 |
</tr> |
| 190 |
</table> |
| 191 |
|
| 192 |
[+ $a[$row][$col] +] </td> |
| 193 |
</tr> |
| 194 |
</table> |
| 195 |
|
| 196 |
<P>[+ $HTML::Embperl::VERSION +]<P> |
| 197 |
|
| 198 |
<P>[+ $tabmode || 17 +]<P> |
| 199 |
<P>[+ local $tabmode = 1 +]<P> |
| 200 |
|
| 201 |
<P> |
| 202 |
|
| 203 |
[- $i = 0 ; while ($i < 10) { $ii[$i++] = "ii[$i] = $i" ; } -] |
| 204 |
|
| 205 |
<table> |
| 206 |
<tr> |
| 207 |
<td>[+ $ii[$row] +] </td> |
| 208 |
</tr> |
| 209 |
</table> |
| 210 |
|
| 211 |
</body> |
| 212 |
</html> |