NAME

Inline::Mason - Inline Mason Script

SYNOPSIS

use Inline::Mason 'as_subs';

print Inline::Mason::generate('HELLO');
print Inline::Mason::HELLO();
print HELLO();
print NIFTY(lang => 'Perl');

Inline::Mason::load_mason
(
 BEATLES
 =>
 'Nothing\'s gonna change my <% $ARGS{what} %>',
 # ... ... ...
 );

print BEATLES(what => 'world');

__END__

__HELLO__
% my $noun = 'World';
Hello <% $noun %>!
How are ya?

__NIFTY__
<% $ARGS{lang} %> is nifty!

DESCRIPTION

This module enables you to embed mason scripts in your perl code. Using it is simple, much is shown in the above.

as_subs is an option. Invoking Inline::Mason with it may let you treat virtual files as subroutines and call them directly.

load_mason lets you create mason scripts in place, and you can pass a list of pairs.

EXTERNAL MASON

You can also use mason scripts which reside in external files. All you need to do is pass their names when you use the module.

use Inline::Mason 'as_subs', [qw(external_mason.pl)];

When duplication happens, in-file mason is picked first.

SEE ALSO

This module uses Text::MicroMason as its backend instead of HTML::Mason, because it is much lighter and more accessible for this purpose. Please go to Text::MicroMason for details and its limitations.

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Yung-chung Lin (a.k.a. xern) <xern@cpan.org>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself