Text::MicroMason::SafeServerPages - Safety ServerPages syntax
use Text::MicroMason; use Text::MicroMason::SafeServerPages; my $m = Text::MicroMason->new(qw/ -SafeServerPages /); my $template = <<'EOF'; <% my $s = \%ARGS; %> <html> <title><%= $s->{title} %></title> <%raw= $s->{body} %> </html> EOF my $cr = $m->compile( text => $template ); print $cr->( title => "Foo<bar>", body => qq{<div class="section">aaaa</div>}, );
Text::MicroMason::SafeServerPages is same as Text::MicroMason::ServerPages but HTML-escaped by default.
Same as Text::MicroMason::ServerPages but =.
<%= perl expression %>
Include evaluated value with HTML-escape.
<%raw= perl expression %>
Include evaluated value without HTML-escape.
cho45 <cho45@lowreal.net>
Text::MicroMason, Text::MicroMason::ServerPages
Original is Text::MicroMason::ServerPages.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Text::MicroMason::SafeServerPages, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::MicroMason::SafeServerPages
CPAN shell
perl -MCPAN -e shell install Text::MicroMason::SafeServerPages
For more information on module installation, please visit the detailed CPAN module installation guide.