NAME

Mason::Manual::Admin - Information for Mason administrators

SETUP

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

LOGGING

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.

    $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.

AUTHORS

Jonathan Swartz <swartz@pobox.com>

SEE ALSO

Mason

AUTHOR

Jonathan Swartz <swartz@pobox.com>

COPYRIGHT AND LICENSE

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.