Questions tagged [mojolicious]

Mojolicious is an MVC web framework in Perl.

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

Features An amazing web framework supporting a simplified single file mode through Mojolicious::Lite. Powerful out of the box with RESTful routes, plugins, Perl-ish templates, session management, signed cookies, testing framework, static file server, I18N, first class unicode support and much more for you to discover.

Features

  • An amazing MVC web framework supporting a simplified single file mode through Mojolicious::Lite. Powerful out of the box with RESTful routes, plugins, Perl-ish templates, session management, signed cookies, testing framework, static file server, I18N, first class unicode support and much more for you to discover.
  • Very clean, portable and Object Oriented pure Perl API without any hidden magic and no requirements besides Perl 5.8.7.

  • Full stack HTTP 1.1 and WebSocket client/server implementation with IPv6, TLS, Bonjour, IDNA, Comet (long polling), chunking and multipart support.

  • Builtin async IO web server supporting epoll, kqueue, UNIX domain sockets and hot deployment, perfect for embedding.

  • Automatic CGI, FastCGI and PSGI detection.

  • JSON and XML/HTML5 parser with CSS3 selector support.

  • Fresh code based upon years of experience developing Catalyst.

Resources and links

672 questions
9
votes
1 answer

NBSP malformed while using Mojo::DOM

I am using Mojo::DOM Perl module to replace tag, but the   entity is replace by Mojo::DOM with \xa0, but when I print it out to the page the NBSP character becomes \x{fffd} and shows up as a question mark. I have tried replace \x{00a0}…
Pradeep
  • 3,093
  • 17
  • 21
9
votes
2 answers

How to use new syntax features in Mojolicious templates

I want to use fancy postfix dereferencing in my Mojo templates. I suppose I could do % use experimental 'postderef'; at the top of every template file, but that seems repetitive and lame. Is there a way I can make Mojolicious import my pragma…
friedo
  • 65,762
  • 16
  • 114
  • 184
9
votes
3 answers

Hypnotoad Logfile

Does Hypnotoad write any Logfile? I can't find anything about that here: http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad Also the option --help says nothing about it. I understand, that application-wise I need to use stuff like…
Boris Däppen
  • 1,186
  • 7
  • 20
9
votes
1 answer

Mojolicious and delayed WebSocket

I have this code snippet, I'm trying to push a string to the server every X seconds like: #!/usr/bin/env perl use Mojolicious::Lite; use EV; use AnyEvent; use POSIX qw(strftime); get '/' => sub { my $self = shift; …
snoofkin
  • 8,725
  • 14
  • 49
  • 86
9
votes
3 answers

Mojolicious Basic Authentication using "under" without Mojolicious::Lite

I am looking for a clean and simple example of how to use the "under" functionality in a "Mojolicious" application. All the examples I find are dealing with "Mojolicious::Lite" (which I don't use). For example I listened to the screencast here…
Boris Däppen
  • 1,186
  • 7
  • 20
9
votes
1 answer

Request Useragent in Mojolicious

I am trying to read the UserAgent from a request and perform operations based on it. Can anyone tell me, how I can get request UserAgent in Mojolicious. Thanks.
PMat
  • 2,039
  • 2
  • 29
  • 46
8
votes
1 answer

Mojolicious::Lite: How to pass parameters when using "redirect_to";

#!/usr/local/bin/perl use warnings; use 5.014; use Mojolicious::Lite; use DBI; # ... get '/choose' => sub { my $self = shift; my $lastname = $self->param( 'lastname' ); my $sth = $dbh->prepare( "SELECT id, firstname, birthday FROM…
sid_com
  • 24,137
  • 26
  • 96
  • 187
8
votes
1 answer

Mojo::UserAgent - Inspect the Content-Encoding header before decoding

I'm attempting use Mojo::UserAgent to verify the gzip compression (Content-Encoding) of an application. Unfortunately, it appears that this UA silently decodes the content and removes the Content-Encoding header afterwords. The following is my…
Miller
  • 34,962
  • 4
  • 39
  • 60
8
votes
1 answer

Mojolicious one liner to service status files with listing directory

I am looking for Mojolicious one liner for serving static files and listing the directory by default I come to this one liner : perl -Mojo -E "a->static->paths(['c:\temp']);a->start" daemon which serving static files on specific directory but its…
dave
  • 867
  • 1
  • 5
  • 11
8
votes
1 answer

"Dynamic" routes in Mojolicious

I would like to implement something like "dynamic" routes in my Mojolicious app. I have some pre-defined "static" routes and a DB table with URL aliases: '/alias' -> '/URL'. Now I'm defining routes on-the-fly and it looks like this: before_dispatch…
deadboy
  • 81
  • 2
8
votes
1 answer

How can I access the current template name in Mojolicious?

I'd like to access the template name in Mojolicious from inside the template itself for debugging purposes, in the same way the Template Toolkit does (see here) The variable __FILE__ works neatly but it refers to the current file and not to the top…
simone
  • 4,667
  • 4
  • 25
  • 47
8
votes
1 answer

How can I take credentials from the command line in a Mojolicious app?

I am developing a Mojolcious standalone application. In the code I am contacting an internal backend where the user should provide some credentials. Currently I am using the credentials inside the code as variables. It looks some something…
smith
  • 3,232
  • 26
  • 55
8
votes
2 answers

Shutting down a Mojo::IOLoop recurring event connected to a Mojo websocket

I'm playing around with Mojolicious and websockets. I want to send the output of multiple external commands on the server to the webpage. I have no problems with connecting and receiving messages, but I also want to send a message back to the server…
brian d foy
  • 129,424
  • 31
  • 207
  • 592
8
votes
1 answer

Mojolicious over HTTPS

I am using Mojolicious for a web app that requires an encrypted connection, but I don't know how to add SSL support to Mojolicious. My coworker sent me these: files domain.key, domain-bundle.crt, domain.crt and my Mojolicious startup looks like…
user2348668
  • 768
  • 7
  • 19
8
votes
3 answers

How can you invoke interactive Perl debugging with hypnotoad or morbo?

I'm new to mojolicious but have been using Perl for some time. I have to jump through some hoops but I can get the interactive Perl debugger (and Komodo) working with remote connections for Apache but I can't find anything about interactive…
1
2
3
44 45