Advertisement
Guest User

Untitled

a guest
Feb 8th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.36 KB | None | 0 0
  1. use Mojolicious::Lite;
  2.  
  3. get '/test' => sub {
  4.     my $c = shift;
  5.  
  6.     $c->render( text => $c->url_for('test')->to_abs );  # works
  7. };
  8.  
  9. helper route_url => sub {
  10.     my $c = shift;
  11.  
  12.     app->log->info( $c->url_for('test')->to_abs);  # generates errors
  13. };
  14.  
  15. Mojo::IOLoop->timer( 3 => sub { app->route_url } );   # give things time to simmer down
  16.  
  17. app->start;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement