#!/usr/bin/env perl use Mojolicious::Lite; # Documentation browser under "/perldoc" plugin 'PODRenderer'; sub validate { my $input=shift; $input =~ s/\W/_/g; return $input; }; get '/' => sub { my $c = shift; $c->render('index'); }; get '/view/:ticket' => sub { my $c = shift; my $ticket = validate($c->param('ticket')); $c->render( 'ticketing', ticket => $ticket, ); }; app->start; __DATA__ @@ index.html.ep % layout 'default'; % title 'Welcome'; Welcome to the Mojolicious real-time web framework! @@ layouts/default.html.ep
##
./Ticketing get '/view/12312`asdf`'
[Mon Jun 22 13:13:10 2015] [debug] Your secret passphrase needs to be changed!!!
[Mon Jun 22 13:13:10 2015] [debug] GET "/view/12312%60asdf%60".
[Mon Jun 22 13:13:10 2015] [debug] Routing to a callback.
[Mon Jun 22 13:13:10 2015] [debug] Rendering template "ticketing.html.ep" from DATA section.
[Mon Jun 22 13:13:10 2015] [debug] Rendering template "layouts/default.html.ep" from DATA section.
[Mon Jun 22 13:13:10 2015] [debug] 200 OK (0.011596s, 86.237/s).
Ticket Viewing
This is where the business happens for 12312_asdf_