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 => 'I ♥ Mojolicious!'};


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
I ♥ Mojolicious!

Duct tape for the HTML5 web

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

use Mojolicious::Lite;

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

# WebSocket service scraping information from remote site
websocket '/title' => sub {
  my $c = shift;
  $c->on(message => sub {
    my ($c, $url) = @_;
    my $title = $c->ua->get($url)->res->dom->at('title')->text;


@@ fetch.html.ep
% my $websocket = url_for 'title';
  var ws = new WebSocket('<%= $websocket->to_abs %>');
  ws.onmessage = function (event) {
    document.body.innerHTML +=;
  ws.onopen = function () {

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

Want to know more?

Take a look at our excellent documentation!