Last active
August 29, 2015 14:05
-
-
Save sgnix/fa3c4e4efe356b2cf326 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/fortunes' => sub { | |
my $self = shift; | |
$sth1->execute(); | |
my $fortunes = $sth1->fetchall_arrayref({}); | |
push @$fortunes, { id => 0, message => 'Additional fortune added at request time.' }; | |
$self->template( 'fortunes', { fortunes => [ sort { $a->{message} cmp $b->{message} } @$fortunes] } ); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment