Fork me on GitHub

A next generation web framework for the Perl programming language.

Back in the early days of the web, many people learned Perl because of a wonderful Perl library called CGI. 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.



All you need is a one-liner, it takes less than a minute.

$ curl | sh

We recommend the use of a Perlbrew environment.

Getting Started

These three lines are a whole web application.

use Mojolicious::Lite;

get '/' => {text => 'Hello World!'};


To run this example with the built-in development web server just put the code into a file and start it with "morbo".

$ morbo
Server available at

$ curl
Hello World!

Duct tape for the HTML5 web

Web development for humans, making hard things possible and everything fun.

use Mojolicious::Lite;

# Simple plain text response
get '/' => {text => 'I ♥ Mojolicious!'};

# Route associating "/time" with template in DATA section
get '/time' => 'clock';

# Scrape information from remote sites
post '/title' => sub {
  my $c     = shift;
  my $url   = $c->param('url') || '';
  my $title = $c->ua->get($url)->res->dom->at('title')->text;
  $c->render(json => {url => $url, title => $title});

# WebSocket echo service
websocket '/echo' => sub {
  my $c = shift;
  $c->on(message => sub {
    my ($c, $msg) = @_;
    $c->send("echo: $msg");


@@ clock.html.ep
% use Time::Piece;
% my $now = localtime;
The time is <%= $now->hms %>.

Single file prototypes like this one can easily grow into well-structured applications.

Want to know more?

Take a look at our excellent documentation!