There's currently only a handful of blockers left on the psgi Catalyst branch in the repo. If you use Catalyst now is definitely the time to cut a clean local::lib for you application and test it out! If you need step by step instructions on how to do that, here's what I do:
1) Create a clean local::lib with Catalyst installed (also install cpanminus to help you later)
curl -L http://cpanmin.us/ | perl - -l ./testcatalystlibs App::local::lib::helper App::cpanminus http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Catalyst-Runtime-5.89002-TRIAL.tar.gz
2) Tell Perl about you new local::lib
./testcatalystlibs/bin/localenv bash
3) Install the rest of your dependencies
cpanm Makefile.PL
And start testing!
Now, for the fun and games part. Since Catalyst is now using Plack natively, that means you can do interesting things like add middleware directly in your Catalyst application subclass, similarly to theway you aggregate Catalyst Plugins.
around 'psgi_app', sub {
my ($orig, $self, @args) = @_;
my $psgi = $self->$orig(@args);
builder {
mount '/static', builder {
Plack::App::Directory
->new(root => $self->path_to('share','static'))
->to_app;
},
mount '/', builder {
enable_if {
$self->debug;
} 'Debug', panels => $self->config->{debug_panels};
$psgi;
}
};
};
This makes your app.psgi super clean:
#!/usr/bin/env perl
use strict;
use warnings FATAL => 'all';
use MyApp::Web;
MyApp::Web->psgi_app;
Personally I find it more natural to add middleware this way, since in my head that middleware is part of the application. Perhaps in the future we can have a cleaner approach than simple wrapping the psgi_app method, or making it easier to use different middlewares in different environments.
Does "cpanm Makefile.PL" really work? Does it work on Module::Install makefiles? Whenever I run that, cpanm tells me that Makefile.PL is not in gzip format, failed to fetch distro, etc.
Amiri
Posted by: Amiri Barksdale | 05/10/2011 at 02:18 AM
Amiri,
Thanks for the catch, yes, you are right. The correct invocation is:
cpanm --installdeps .
This assumes you are using something like local::lib to manage dependencies at the user level.
John
Posted by: john | 05/12/2011 at 09:04 PM
I agreed with these post and give some suggestion for the getting new and innovative ideas.It can improve the ranking of your website.
Posted by: Web Development Company | 09/29/2011 at 02:46 AM