Text::MicroMason::Mason

Text::MicroMason::Mason is a simple compiler for Mason-style Templating.
Download

Text::MicroMason::Mason Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Matthew Simon Cavalletto
  • Publisher web site:
  • http://search.cpan.org/~ferrency/

Text::MicroMason::Mason Tags


Text::MicroMason::Mason Description

Text::MicroMason::Mason is a simple compiler for Mason-style Templating. Text::MicroMason::Mason is a simple compiler for Mason-style Templating.SYNOPSISMason syntax provides several ways to mix Perl into a text template: < %args > $name < /%args > % if ( $name eq 'Dave' ) { I'm sorry < % $name % >, I'm afraid I can't do that right now. % } else { < %perl > my $hour = (localtime); my $daypart = ( $hour > 11 ) ? 'afternoon' : 'morning'; < /%perl > Good < % $daypart % >, < % $name % >! % } < & "includes/standard_footer.msn" & > < %doc > Here's a private developr comment describing this template. < /%doc >Create a Mason object to interpret the templates: use Text::MicroMason; my $mason = Text::MicroMason->new();You can compile and execute templates using the standard MicroMason methods: $coderef = $mason->compile( file => 'simple.tmpl' ); print $coderef->( %arguments ); print $mason->execute( file => 'simple.tmpl', %arguments ); Here are some key features of "Text::MicroMason::Mason": · Template interpolation with · Literal Perl lines with leading % · Named %args, %perl, %once, %init, %cleanup, and %doc blocks · The $m mason object, although with many fewer methods · Expression filtering with |h and |u (via -Filter mixin) Requirements: · Perl


Text::MicroMason::Mason Related Software