Do not you know a method to carry out the following code like php?
<html>
<?perl
print( 'test' );
?>
</html>
using HTML::Mason:
<%perl>
use Date::Calc;
my @today = Date::Calc->Today();
my $str = "$today[0]-$today[1]-$today[2]";
</%perl>
<html>
<body>
Today is <%$str %>
</body></html>
Apache Config:
PerlModule HTML::Mason::ApacheHandler
<Location /usr/local/apache/htdocs/mason>
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</Location>
The syntax is a little different, but that's the approach used by HTML::Mason.
Personally, I prefer a templating system that encourages more separation of code and presentation. Template Toolkit does that while allowing flexibility to do just about anything you'd ever want to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With