Mojolicious 7.29

Real-time web framework


Platform: CPAN

Language: Perl

License: Artistic-2.0


View on registry:

Mojolicious Build Status Windows build status

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 endeavor to implement this idea using bleeding edge technologies.


  • An amazing real-time web framework, allowing you to easily grow single file prototypes into well-structured MVC web applications.
    • Powerful out of the box with RESTful routes, plugins, commands, Perl-ish templates, content negotiation, session management, form validation, testing framework, static file server, CGI/PSGI detection, first class Unicode support and much more for you to discover.
  • A powerful web development toolkit, that you can use for all kinds of applications, independently of the web framework.
    • Full stack HTTP and WebSocket client/server implementation with IPv6, TLS, SNI, IDNA, HTTP/SOCKS5 proxy, UNIX domain socket, Comet (long polling), keep-alive, connection pooling, timeout, cookie, multipart, and gzip compression support.
    • Built-in non-blocking I/O web server, supporting multiple event loops as well as optional pre-forking and hot deployment, perfect for building highly scalable web services.
    • JSON and HTML/XML parser with CSS selector support.
  • Very clean, portable and object-oriented pure-Perl API with no hidden magic and no requirements besides Perl 5.22.0 (versions as old as 5.10.1 can be used too, but may require additional CPAN modules to be installed)
  • Fresh code based upon years of experience developing Catalyst, free and open source.


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

$ curl -L | perl - -M -n Mojolicious

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

Use all the latest Perl and HTML features in beautiful single file prototypes like this one, and grow them easily into well-structured applications.

use Mojolicious::Lite;
use 5.20.0;
use experimental 'signatures';

# Render template "index.html.ep" from the DATA section
get '/' => {template => 'index'};

# WebSocket service used by the template to extract the title from a website
websocket '/title' => sub ($c) {
  $c->on(message => sub ($c, $msg) {
    my $title = $c->ua->get($msg)->result->dom->at('title')->text;


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

Want to know more?

Take a look at our excellent documentation!


  • 7.29 - March 14, 2017 23:27
  • 7.28 - March 07, 2017 21:36
  • 7.27 - February 27, 2017 17:02
  • 7.26 - February 15, 2017 23:08
  • 7.25 - February 09, 2017 22:51
  • 7.24 - February 05, 2017 21:09
  • 7.23 - January 29, 2017 21:43
  • 7.22 - January 25, 2017 23:09
  • 7.21 - January 22, 2017 14:29
  • 7.20 - January 18, 2017 09:38
See all 579 releases

Project Statistics

SourceRank 19
Dependencies 5
Dependent projects 549
Dependent repositories 116
Total releases 579
Latest release
First release
Stars 1.8K
Forks 436
Watchers 243
Contributors 97
Repo Size: 22.4 MB

Top Contributors See all

Sebastian Riedel Joel Berger Marcus Ramberg Abhijit Menon-Sen Viacheslav Tykhanovskyi Mark Stosberg Yuki Kimoto Nils Diewald Acajou Dan Book Graham Barr Jan Henning Thorsen jamadam Pedro Melo Kenichi Ishigaki Ask Bjørn Hansen Yaroslav Korshak Alex Oleg Zoffix Znet

Something wrong with this page? Make a suggestion

Export .ABOUT file for this library

Last synced: 2017-03-15 04:56:17 UTC

Login to resync this project