View / Download this file.
-------
DO TAGS
-------
----------
TAG FORMAT
----------
Where "Perl" represents your Perl code:
<?DO Perl; DO?>
<?do Perl; do?>
<?do Perl; ?>
<? Perl; ?>
<?
Perl;
?>
-----------
DESCRIPTION
-----------
The DO tag is designed to allow the developer an area in which to put
straight Perl code in their PTM documents. Any code written here should be
formatted the same way in which you would write code in a normal Perl/CGI
document. This includes the use of semicolons (;) at the end of each Perl
statement. All types of Perl statements are allowed here including the use
of "print" statements.
--------------
USAGE EXAMPLES
--------------
----------------------------------
Example 1: Simple Value Assignment
----------------------------------
<? $x = 'hello world!'; ?>
----------------------------------------
Example 2: Printing 1-10 with a For Loop
----------------------------------------
<?
for ($i = 1; $i <= 10; $i++) {
print ($i);
}
?>
---------------------------------------------------------------------------
Example 3: Printing Number: 1-10 with a For Loop, HTML, and the DISPLAY tag
---------------------------------------------------------------------------
<? for ($i = 1; $i <= 10; $i++) { ?>
<b>Number: </b><?= $i ?><br>
<? } ?>
|