[Pdx-pm] Mojolicious anyone?

Joshua Keroes joshua at keroes.com
Sun Jan 9 13:11:46 PST 2011

Checked it out during a plane flight last week. It seems to cover all of the
same features that PerlDancer does, almost down the line. I just deployed a
Dancer app last week so I'm fond of that one.

Mojolicious expands on the knowledge picked up from Catalyst before it, so
even though it's new, it's reasonably mature even at version 1.01.

Mojolicious has a better route-builder. Both Dancer and Mojolicious support
named variables in the routes (e.g. /path/to/:id, where $id or param->{id}
or something similar) will be available in the route handler, Mojo also
permits you to use regular expressions AND named variables. Dancer makes you
choose one or the other. It's not a huge difference, but Mojo's flexibility
here will make for more legible code and save a line or two later.

Dancer's documentation seems to map into my mind better. I much prefer
Dancer's default templating system (and any of the alternatives, really) to
Mojo's default, which seems to be something wrapped around HTML::Ep. (Please
correct me on that, I was offline when I was looking at those docs)

If you'd like to compare them yourself, I'd suggest deploying three
frameworks: Dancer's default (there's only one; e.g. dancer -a
Your::Application), and both types of Mojolicious builds: (e.g. mojo
generate lite_app Your::App and mojo generate app Your::Full::App).


On Sun, Jan 9, 2011 at 12:29 AM, Daniel Hedlund <daniel at digitree.org> wrote:

> Has anyone had a chance to play around with Mojolicious
> (http://mojolicio.us/)?  If so, what's been your experience with it?
> It looks very cool and reminds me a lot of the Sinatra DSL for Ruby,
> but with support for some HTML5 features out of the box (i.e.
> websockets).  If there's any interest, I could try to give a
> demonstration at a future meeting.
> A couple examples from their website...
> # Simple route with plain text response
> get '/hello' => sub { shift->render(text => 'Hello World!') };
> # WebSocket echo service
> websocket '/echo' => sub {
>    my $self = shift;
>    $self->on_message(
>        sub {
>            my ($self, $message) = @_;
>            $self->send_message("echo: $message");
>        }
>    );
> };
> Cheers,
> Daniel Hedlund
> daniel at digitree.org
> _______________________________________________
> Pdx-pm-list mailing list
> Pdx-pm-list at pm.org
> http://mail.pm.org/mailman/listinfo/pdx-pm-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/pdx-pm-list/attachments/20110109/de861261/attachment.html>

More information about the Pdx-pm-list mailing list