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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
|
<html>
<head>
<title>Some Plain tests Embperl</title>
</head>
<body>
Here it starts with some HTML Text<P>
All values should be undefined:
$a = [+ $a +] <BR>
$b = [+ $b +] <BR>
$c = [+ $c +] <BR>
$d = [+ $d +] <BR>
$e = [+ $e +] <BR>
First of all assign a value:
[- $a = '(this is the value in $a)' -] <BR>
Now we have some 'Umlaute':
[- $b = "$a äöü" -]
Now lets look what we are getting from this:<BR>
[+ $a +] [+ $b +]<BR>
And now a and b together: [+ "$a$b" +]<P>
Here we have some HTML tags within the perl code, Embperl will delete them!<BR>
[+ $c = <BR> 6 + 17 <font size="3"> * 3 +]
Embperl will also translate HMTL escapes to the right characters i.e. $a &lt; 6 will get the perl expression $a < 6: <BR>
[- $e = 2 -]
[+ $d = $e < 6 +]
Now they should have a value
$a = [+ $a +] <BR>
$b = [+ $b +] <BR>
$c = [+ $c +] <BR>
$d = [+ $d +] <BR>
$e = [+ $e +] <BR>
[- $a = 1; $b = 0; $c = 5; $d = 'txt' -]
[$if $a$]
a <br>
[$ endif$]
[$if $a $]
a <br>
[$else$]
not a<br>
[$ endif $]
[$ if $a$]
a <br>
[$if $b == 0$]
b is null <br>
[$else$]
b is not null <br>
[$endif$]
[$ else$]
not a<br>
[$ endif $]
[$ if $a$]
a <br>
[$if $b == 0$]
b is null <br>
[$else$]
b is not null <br>
[$endif$]
[$ else$]
not a<br>
[$if $b == 0$]
b is null <br>
[$else$]
b is not null <br>
[$endif$]
[$ endif $]
[$ if !$a$]
not a <br>
[$if $b == 0$]
b is null <br>
[$else$]
b is not null <br>
[$endif$]
[$ else$]
a<br>
[$if $b == 0$]
b is null <br>
[$else$]
b is not null <br>
[$endif$]
[$ endif $]
[- $i = 0 -]
[$ while $i <= $#ffld $]
[+ $ffld[$i] +] = [+ $fdat{$ffld[$i]} +]
[- $j = 0 -]
[$ while $j <= $i $]
[+ $j++ +]
[$ endwhile $]
<BR>
[- $i++ -]
[$ endwhile $]
<table>
<tr>
<td>[+ $c[$row][$col] +] </td>
</tr>
</table>
<p> $tabmode = default <p>
<hr><p>Display an two dimensional array with one, two and three columns !<BR>
Please take a look at the source in your browser to see the difference<BR>
[-
undef @a ;
undef @b ;
$a[0][0] = 'a1/1' ;
$a[1][0] = 'a2/1' ;
$a[1][1] = 'a2/2' ;
$a[2][0] = 'a3/1' ;
$a[2][1] = 'a3/2' ;
$a[2][2] = 'a3/3' ;
$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' ;
$maxcol=99 ;
-]
$a[0][[0] = '1/1' ;<BR>
$a[1][[0] = '2/1' ;<BR>
$a[1][[1] = '2/2' ;<BR>
$a[2][[0] = '3/1' ;<BR>
$a[2][[1] = '3/2' ;<BR>
$a[2][[2] = '3/3' ;<BR>
<P>$tabmode = default <P>
<table border="2" width="100%">
<tr>
<td>[+ $a[$row][$col] +] </td>
</tr>
</table>
<table border="2" width="100%">
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
<tr>
<td>[+ $a[$row][$col] +] </td>
</tr>
</table>
<table border="2" width="100%">
<tr>
<th>[+ $b[2][$col] +]</th>
</tr>
<tr>
<td>[+ $a[$row][$col] +] </td>
</tr>
</table>
<table>
<tr>
<td>
<table>
<tr>
<td>[+ $b[$row][$col] +] </td>
</tr>
</table>
[+ $a[$row][$col] +] </td>
</tr>
</table>
<P>[+ $HTML::Embperl::VERSION +]<P>
<P>[+ $tabmode +]<P>
<P>[+ local $tabmode = 1 +]<P>
<P>
[- $i = 0 ; while ($i < 10) { $ii[$i] = "ii[$i] = $i" ; $i++ ; } -]
<table>
<tr>
<td>[+ $ii[$row] +] </td>
</tr>
</table>
[- @fe = (1, 10, 100, 1000) -]
[$ foreach $fe @fe $]
[+ $fe +]
[$ endforeach $]
</body>
</html>
|