test.pl (Plain text version)

#!/usr/bin/perl
use PerlHP;

<html>
<head><title>It's a test page!</title></head>
<body>
<h1>PerlHP test page</h1>

<?
# Here's a comment
print "<h3>Three random numbers: ".int(rand 10)." ".int(rand 10)." ".int(rand 10)."</h3>";
print "<h3>The time is: ".localtime time."</h3>";
?>
<hr>

<? print "<h3>Value is: &quot;".escape_html($arg)."&quot;</h3>" if($arg); ?>
<form action="test.pl" method="get">
<input name="arg" type="text" value="">
<input type="submit" value="Submit">
</form>
<hr>

<h3>Ten stars, drawn with an interleaved loop: 
<? for(1..10) { ?>
*
<? } ?>
</h3>

<?
$counter++;
print "<h3>You've looked at this page ".escape_html($counter)." times.</h3>";
cookie("counter",$counter);
?>

<? header("X-PerlHP: AWESOME") ?>

</body>
</html>