Text::MicroMason::Functions

Text::MicroMason::Functions Perl module contains Function Exporter for Simple Mason Templates.
Download

Text::MicroMason::Functions 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::Functions Tags


Text::MicroMason::Functions Description

Text::MicroMason::Functions Perl module contains Function Exporter for Simple Mason Templates. Text::MicroMason::Functions Perl module contains Function Exporter for Simple Mason Templates.SYNOPSISUse the execute function to parse and evalute a template: use Text::MicroMason::Functions qw( execute ); print execute($template, 'name'=>'Dave');Or compile it into a subroutine, and evaluate repeatedly: use Text::MicroMason::Functions qw( compile ); $coderef = compile($template); print $coderef->('name'=>'Dave'); print $coderef->('name'=>'Bob');Templates stored in files can be run directly or included in others: use Text::MicroMason::Functions qw( execute_file ); print execute_file( "./greeting.msn", 'name'=>'Charles');Safe usage restricts templates from accessing your files or data: use Text::MicroMason::Functions qw( safe_execute ); print safe_execute( $template, 'name'=>'Bob');All above functions are available in an error-catching "try_*" form: use Text::MicroMason::Functions qw( try_execute ); ($result, $error) = try_execute( $template, 'name'=>'Alice');As an alternative to the object-oriented interface, text containing MicroMason markup code can be compiled and executed by calling the following functions.Please note that this interface is maintained primarily for backward compatibility with version 1 of Text::MicroMason, and it does not provide access to some of the newer features.Each function creates a new MicroMason object, including any necessary traits such as Safe compilation or CatchErrors for exceptions, and then passes its arguments to an appropriate method on that object.You may import any of these functions by including their names in your use Text::MicroMason statement. Requirements: · Perl


Text::MicroMason::Functions Related Software