Mason::Manual::Setup(3pm) User Contributed Perl Documentation Mason::Manual::Setup(3pm)NAME
Mason::Manual::Setup - Setting up Mason
SETUP
Web development
The most common use of Mason is to generate dynamic web content.
Poet is a web framework designed specifically to work with Mason. Given an HTTP request, Poet generates a corresponding Mason request, and
uses the output from Mason to form the HTTP response. Poet takes care of the web development details that are outside of Mason's domain,
such as server integration and configuration. Poet::Manual::Tutorial shows how to set up a Poet/Mason site in great detail.
Mason can also be used in the popular web frameworks Catalyst and Dancer, as a drop-in replacement for their default template engines. See
Catalyst::View::Mason2 and Dancer::Template::Mason2.
Non-web development
Mason can be used to generate any kind of dynamic content. I have personally used it to generate Apache configuration files, emails, and
C++ code.
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();
If you want to process a directory with a mix of Mason templates and static files, check out Any::Template::ProcessDir.
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 direct thesse logs to the output of your
choice; see Log::Any::Adapter. If you don't specify anything then the logs will go into the void.
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.
perl v5.14.2 2012-05-02 Mason::Manual::Setup(3pm)
Check Out this Related Man Page
Mason::Component::Moose(3pm) User Contributed Perl Documentation Mason::Component::Moose(3pm)NAME
Mason::Component::Moose - Moose policies and exports for Mason components
DESCRIPTION
This module is automatically included in each generated Mason component class, and is equivalent to
use CLASS;
use Moose;
use MooseX::HasDefaults::RW;
use Method::Signatures::Simple;
OVERRIDING
To override the default behavior, subclass this class and specify it as "base_component_moose_class" to Mason::Interp.
For example, to use MooseX::StrictConstructor in every component:
package My::Mason::Component::Moose;
use Moose::Exporter;
use MooseX::StrictConstructor ();
use base qw(Mason::Component::Moose);
sub init_meta {
my $class = shift;
$class->SUPER::init_meta(@_);
MooseX::StrictConstructor->init_meta(@_);
}
...
my $interp = Mason::Interp->new(..., base_component_moose_class => 'My::Mason::Component::Moose');
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.
perl v5.14.2 2012-05-02 Mason::Component::Moose(3pm)
Hi,
my company is considering a new development of our web site, which used to run on Apachi over Solaris.
The company who is going to do this for us knows only about developing it in ASP.
I guess this means we'll have to have another ISS server on NT for these dynamic pages :(
What are... (5 Replies)
hi i am Currently useing Windows NT with Apache and i am thinking of chaning to Liunx (redhat) :o But i am Not Sure Yet is Linux Easy to Setup and Use i Will be Downloading.Redhats FTP site it from and i do have a Burner and i if i use Linux i will Loss support For ASP right??
Please Help... (5 Replies)
I'm just starting out in scripting (taking online classes) but I need to know how to clean out (delete) the content of a number of logs. All of the files end in 'trc'. Does anyone have a script or command (SED or AWK) I can use?
Julie (4 Replies)
Well I have been a network admin over 4 years and am wanting to get more into programming, web development and database management. As such I have gone back to school for web development, during my classes I will take a part on C++ which I have been interested in learning. The question I basically... (3 Replies)
I have one syntax to find something from desktop on server, the script is as below, I actually speaking don't know anything in this script.
It creates a window, where i get a drop down boxes with folder names given below and a blank box where i have to put the folder name to search. and then I... (2 Replies)
Im completely new to programming and dont really know much about it. I want to start learning about Web Development but i have no idea where to start. Any suggestions? (3 Replies)
Please pardon my ignorance, but I need to create a web-based form which can be used to request access to the unix servers in our environment. It just needs to have input fields for basic info (name, dept., etc.), and perhaps a drop-down box with the names of the servers. The form will be submitted... (2 Replies)
I'm wondering how programmers develop new Web Development languages because I want to learn how everything begins from the start. Let's say I'm planning to write a new language for the Web. How do I do this? Is there anyone who knows about the way Web Development languages first appear ? I'm... (3 Replies)
I am just wondering why do programmers are using this when programming the web? When you making a joomla templates and the more focus in your mind is to target the search engines then java is very important.Not to use that. (2 Replies)
Hello,
After a bit of basic advice please. What web development languages are available and what are the advantages of each? If this is too basic a question, can someone please signpost so i may research this.
I ask as I have a couple of websites that i need to develop but new to programming... (16 Replies)
Hi All,
I am currently managing a web site. I find that during the peak time period,ie,between 1300hrs to 2100hrs everyday,the response slows down whenever i access the applications hosted by the server.However when i try to access the static content in the web server,it loads quickly.
The... (2 Replies)
I have scouted around the last few years and always see that for a individual person to create a dynamic development environment in Mac takes a PHD or something close.
Or there are a lot of miss leading info.
I would rather work with raw code compared to a wysiwyg editor of any flavor.
At this... (5 Replies)
Hi,
Thanks RudiC for bringing up the order of the timestamp. Yes it does matter. Please help.
Current Setup:
Logs were rotated every 4hrs and they were compressed. If the logs exceed 10gb, it will be compressed (.Z), if not script will just zipped the logs (.gz). So archive directory may... (8 Replies)
Oracle JET is marketed as a kind of "anti-framework" approach to web development but from my experience Oracle JET is just another type of framework. So, I would describe JET as "a meta-framework" because JET is a framework that is built to import and use other frameworks and Javascript... (4 Replies)