Skip to content

Instantly share code, notes, and snippets.

@TristinDavis
Forked from sshaw/gist:1984738
Created November 19, 2012 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TristinDavis/4108336 to your computer and use it in GitHub Desktop.
Save TristinDavis/4108336 to your computer and use it in GitHub Desktop.
Mojolicious::Controller using CGI::Expand
use Mojo::Base 'Mojolicious';
use CGI::Expand;
sub startup
{
my $self = shift;
$self->hook(before_dispatch => sub {
my $c = shift;
my $hash = CGI::Expand->expand_hash($c->req->params->to_hash);
$c->param($_ => $hash->{$_}) for keys %$hash;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment