Mason::Manual::Admin - Information for Mason administrators
To serve web requests directly with Mason, use the PSGI plugin. PSGI integrates with a wide variety of server backends including mod_perl, FastCGI, CGI, and various Perl-based servers.
To use Mason as a view in a Catalyst application, use Catalyst::View::Mason2.
To use Mason from a script or library, use the Mason::Interp API:
my $interp = Mason->new( comp_root => '/path/to/comps', data_dir => '/path/to/data', ... ); my $output = $interp->run( '/request/path', foo => 5 )->output();
To try out Mason syntax from the command line, use the mason script:
% mason 2 + 2 = <% 2+2 %> ^D 2 + 2 = 4
Mason uses Log::Any to log various events, such as the start and end of each request. You can also log to Log::Any from a component with the $m->log method. e.g.
Log::Any
$m->log
$m->log->error("Something bad happened!"); $m->log->debugf("Arguments for '%s' were '%s'", $func, \%args) if $m->log->is_debug;
See Log::Any::Adapter for how to direct these logs to an output of your choice.
Log::Any::Adapter
Jonathan Swartz <swartz@pobox.com>
Mason
This software is copyright (c) 2011 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Mason, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mason
CPAN shell
perl -MCPAN -e shell install Mason
For more information on module installation, please visit the detailed CPAN module installation guide.