How to create portable web application in Perl

How to create portable web application in Perl

I'm Yuki kimoto, Japanese perl programmer.

I like creating web application by perl.
I release GitPrep a few weeks ago.

This is very portable web application and inatallation is easy.
Requirement is only Perl 5.8.7.
What technology is used?
I explain a little.

GitPrep(Github)

cpanm

cpanm is very good. cpanm can specify module version in cpanfile.

this is cpanfile.

    requires 'DBI', '== 1.625';
    requires 'DBD::SQLite', '== 1.37';
    requires 'Object::Simple', '== 3.09';
    requires 'DBIx::Custom', '== 0.28';

And I prepare setup.sh. this is automatically setup script for application.

    #!/bin/sh
    perl cpanm -n -l extlib Module::CoreList
    perl -Iextlib/lib/perl5 cpanm -n -L extlib --installdeps .

At first, install latest Module::CoreList and install modules by cpanm with --installdeps.

Mojolicious

Mojolicious have built-in prefork server and support CGI.

you can create web application which run multiple environment.

mojo-legacy

Mojolicious support Perl 5.10.1+.
so Mojolicious don't work on Perl 5.8.

mojo-legacy project is Mojolicious backport to Perl 5.8.7.
You can create web application which run on Perl 5.8.7+.

mojo-legacy

2 Comments

Nice technique using setup.sh

I did not know about cpanfile. There is no mention of it in the cpanm documentation.

Leave a comment

About Yuki Kimoto

user-pic I am Yuki Kimoto, Japanese Perl programmer. I create tutorial site in Japanese and English. I create Perl module and upload it to CPAN. I create Web application in Github.