www.opensourcewebbook.com
 
     
  Page Path - Contents - Mason  
     
 
Home
About
Foreword
Reviews
Authors
Purchase
Errata
Sourcecode
Resources
Tools
Contents
Linux
Apache
Perl
MySQL
WML
CGI
mod_perl
SSI
Embperl
Mason
PHP
     

HTML::Mason

HTML::Mason (aka Mason - see www.masonhq.com/) is a Perl module created by Jonathan Swartz. Its function is similar to Embperl: to include Perl code within an HTML page. The following are some of the features of Mason.

  • Simple embedded Perl syntax - An HTML file can harness the power of Perl, including variables (scalar, arrays, hashes, and so on), complex data types, and flow-control constructs.
  • Modular pages with components - Create subroutine-like code, known as components, to generate headers, footers, menus, and so on.
  • Parameter handling - It provides easy accesss to GET/POST parameters, including assigning default values and triggering error conditions.
  • Templates and filters - A template can be created and applied to the entire site or a portion of the site.
  • Object-oriented techniques - The power of Perl and its object-oriented features can be used.
  • Caching - When the code on a page or componenet is cached, the next time the page or component is requested, the cached version is executed.
  • Previewing - A built-in previewer can be used to review a page, using a number of client and request conditions.
  • Staging/production modes - Mason can be configured to use a staging server or staging area for development.

Mason Links

Mason Headquarters

 

     

EXAMPLES:

test.html:
test.html
test.html contents

percent.html:
percent.html
percent.html contents

cond.html:
cond.html
cond.html contents

loop.html:
loop.html
loop.html contents

perl.html:
perl.html
perl.html contents

handling form data:
form.html
form.html contents
handleform.html contents

components part 1:
components.html
_header
_footer
components.html.txt

components part 2:
components2.html
_header2
_footer2
components2.html.txt

HTML::Mason Project

Product Backend: /mason/productbackend/
_top
_leftrail
_bottom
bare.html
bare.html contents
_select_form
index.html
index.html contents
_man_form
_prod_form
continue/index.html
finished/index.html