A templated route 

get '/' => sub {
    my $time = POSIX::strftime('%T', localtime);
    my $tod  = $time lt '12:00' ? 'Morning' :
               $time lt '17:00' ? 'Afternoon' : 'Evening';

    template 'index', { time => $time, time_of_day => $tod };
};