#!/usr/bin/perl use strict; use warnings; use Mojolicious::Lite; use Time::HiRes 'time'; get '/' => sub { my $c = shift; $c->clock; $c->render('index') }; helper clock => sub { my $c = shift; $c->stash(clock => time) }; app->start; __DATA__ @@ index.html.ep <!DOCTYPE html> <html> <head> <META http-equiv="refresh" content="1;<%=url_for('/')->to_abs%>"> <title>MojoClock</title></head> <body> <h1><%= $clock %></h1> </body> </html>
In reply to Re: Mojolicious refresh
by Anonymous Monk
in thread Mojolicious refresh
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |