Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

MasonX::Lexer::MSP
Give Mason a more ASP/JSP compatible syntax

MasonX::Lexer::MSP - Give Mason a more ASP/JSP compatible syntax


NAME

MasonX::Lexer::MSP - Give Mason a more ASP/JSP compatible syntax


SYNOPSIS


    my $interp = HTML::Mason::Interp->new( 

                 data_dir => '/here',

                 comp_root => '/there',

                 lexer_class => 'MasonX::Lexer::MSP',

                 );


DESCRIPTION

This lexer makes changes to the Mason syntax to make it closer to the syntax used by ASP and JSP. These changes are incompatible with the default Mason syntax, unfortunately.


Syntax Changes

The in-line code tag used by ASP and JSP is this: (which conflicts with Mason's default substitution tag)


    <% $var = 'perl code'; %>

The substitution tag is this:


    <%= $var %>

Perl-lines are disabled by default. I consider them syntactically dangerous, but if you like them you can have them back by setting the 'perl_lines' parameter to 1.


    my $interp = HTML::Mason::Interp->new( 

                 data_dir => '/here',

                 comp_root => '/there',

                 lexer_class => 'HTML::Mason::Lexer::MSP',

                 perl_lines => 1,

                 );

The last addition is JSP-style hidden comments, which begin with '<%--' and end with '--%>'. The comments do not appear in the component output, similar to a <%doc> section. The comment may contain any text except the ending tag. If you need to put the ending tag in, escape the last character like this: '--%\>'.


    <%-- this text will not appear in the output --%>


Other Syntax

Everything else is the same.


AUTHOR

John Williams, <williams@tni.com>


SEE ALSO

the HTML::Mason::Lexer manpage.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy