A next generation web framework for the Perl programming language.
Back in the early days of the web there was this wonderful Perl library called CGI.pm, many people only learned Perl because of it. It was simple enough to get started without knowing much about the language and powerful enough to keep you going, learning by doing was much fun. While most of the techniques used are outdated now, the idea behind it is not. Mojolicious is a new attempt at implementing this idea using state of the art technology.

Features
  • An amazing MVC web framework supporting a simplified single file mode through Mojolicious::Lite .
  • Very clean and Object Oriented pure Perl API without any hidden magic and no requirements besides Perl 5.8.1.
  • Full stack HTTP 1.1 and WebSocket client/server implementation with IPv6 and TLS support.
  • Builtin async IO and prefork web server with epoll, kqueue, hot deployment and UNIX domain socket sharing support, perfect for embedding.
  • CGI, FastCGI and PSGI support.
  • Fresh code, based upon years of experience developing Catalyst .
And much more for you to discover!

Mojolicious
The Mojolicious web framework is all about minimalism and simplicity. True to its Perlish roots making simple things easy and hard things possible. A project can be started as a single file web application using Mojolicious::Lite and later grow to a well structured Mojolicious application.
#!/usr/bin/env perl
use Mojolicious::Lite;

# /
get '/' => 'index';

# /*
get '/:groovy' => sub {
    my $self = shift;
    $self->render_text($self->param('groovy'), layout => 'funky');
};

shagadelic;
__DATA__

@@ index.html.ep
% layout 'funky';
Yea baby!

@@ layouts/funky.html.ep
<!doctype html><html>
    <head><title>Funky!</title></head>
    <body><%= content %></body>
</html>
% ./myapp.pl daemon
Server available at http://127.0.0.1:3000.
Mojolicious::Lite itself is just a thin wrapper around Mojolicious, making the transition process very smooth and straight forward. At its core Mojolicious uses a new implementation of the famous Routes concept, adding some advanced techniques from Catalyst.
# /admin (authentication)
my $admin = $r->bridge('/admin')->to('admin#auth');

# /admin/articles/*
$admin->route('/articles/(*title)')->to('admin#edit');

# /admin/*
$admin->route('/:action')->via('get')->to('admin#index');
Controllers are normal Perl classes and actions just methods, there is no hidden magic to be afraid of.
package Blog::Admin;
use base 'Mojolicious::Controller';

# Authenticate
sub auth {
    my $self = shift;

    # Allright it's Bender
    return 1 if $self->req->headers->header('X-Bender');

    # Not Bender
    return;
}

# Take param and send text message
sub edit {
    my $self = shift;
    my $name = $self->param('name');
    $self->render_text("What's up $name?");
}

# Render templates/admin/index.html.ep
sub index {}

# Render templates/posts.json.tt
sub list {
    shift->render(
        template => 'posts',
        format   => 'json',
        handler  => 'tt'
    );
}

1;
Views can use all kinds of template engines from Mojo::Template over Mason to Template Toolkit , the renderer will select the appropriate one just by looking at the file extension. Models are entirely optional and any given Perl module will just work, the same goes for JavaScript libraries.

Installation
Getting started with Mojolicious is very simple because all you need is Perl 5.8.1 (or greater), thats it. On most UNIX operating systems such as Mac OS X or Linux, Perl comes preinstalled and you only have to run a single command. For Windows we suggest using Strawberry Perl .
A manual installation is just as easy.
Now build great web applications and have fun!