sparkles Mojolicious - Perl real-time web framework

License: Artistic-2.0

Language: Perl

Keywords: event-loop, html, http, json, mojolicious, mvc, perl, user-agent, web-framework, web-server, websocket

Build Status Windows build status

Mojolicious is a fresh take on Perl web development, based on years of experience developing the Catalyst framework, and utilizing the latest web standards and technologies. You can get started with your project quickly, with a framework that grows with your needs.

The Mojo stack provides a consistent set of components that can be used in any project. The guides cover most aspects of using the framework and the components have comprehensive reference documentation. Mojolicious is a real-time web framework, which allows a new class of web applications using WebSockets and having long-running requests without blocking.

Join us now, and be a part of a friendly and knowledgeable community of developers!


  • 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), Promises/A+, 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.26.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.
  • Hundreds of 3rd party extensions and high quality spin-off projects like the Minion job queue.


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 Model-View-Controller web applications.

use Mojolicious::Lite -signatures;

# Render template "index.html.ep" from the DATA section
get '/' => sub ($c) {
  $c->render(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!

Project Statistics

Sourcerank 17
Repository Size 24.8 MB
Stars 2,172
Forks 503
Watchers 244
Open issues 38
Dependencies 0
Contributors 119
Tags 672
Last updated
Last pushed

Top Contributors See all

Sebastian Riedel Joel Berger Marcus Ramberg Abhijit Menon-Sen Dan Book Viacheslav Tykhanovskyi Mark Stosberg Yuki Kimoto Jan Henning Thorsen shadowcat-mst Nils Diewald Pascal Gaudette Graham Barr CandyAngel jamadam Pedro Melo Kenichi Ishigaki Ask Bjørn Hansen Yaroslav Korshak Alex Valuyskiy

Packages Referencing this Repo

Real-time web framework
Latest release 8.27 - Updated - 2.17K stars

Recent Tags See all

v8.27 December 04, 2019
v8.26 November 03, 2019
v8.25 September 29, 2019
v8.24 September 11, 2019
v8.23 August 12, 2019
v8.22 July 17, 2019
v8.21 July 14, 2019
v8.20 July 09, 2019
v8.19 July 08, 2019
v8.18 June 28, 2019
v8.17 May 23, 2019
v8.16 May 19, 2019
v8.15 April 26, 2019
v8.14 April 18, 2019
v8.13 March 21, 2019

Interesting Forks See all

Mojolicious: Duct Tape For The Web!
Perl - Artistic-2.0 - Last pushed - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-12-04 19:59:57 UTC

Login to resync this repository