#!/usr/bin/perl -- use Mojolicious::Lite; helper my_foo => sub { my( $c ) = @_; $c->url_for('/')->to_abs.'?'.$c->url_with->query; }; any '/' => { template => 'index', time => scalar localtime };;; app->start; __DATA__ @@ index.html.ep <%= $time =%>
<%= url_for('/')->to_abs %>?<%= url_with->query %>
<%= my_foo() =%>
__END__