December 2002
Intermediate to advanced
496 pages
9h 40m
English
As we saw earlier, Embperl commands start with a “[” and end with a “]”. Because “[” has a special meaning, to put a “[”on your web page, you must write it as “[[”.
The code within [+ ... +] is executed, and the result is that the command is replaced with what the code evaluates to. Thus [+ "hello!" +] is the same as print "hello!" in a normal CGI program. For example:
<p>Hello [+ $name +]</p>
If the value of $name is “Gerald Richter”, the result of the previous command after Embperl is through processing it is this:
<p>Hello Gerald Richter</p>
A command can contain any Perl expression, including array elements, hash elements, and function calls:
[+ $i+1 +] [+ $a[$i] +] [+ $info{name} +] [+ ...Read now
Unlock full access