sub edit { my $self = shift; my $template = $self->load_tmpl( 'edit.tmpl', die_on_bad_params => 0); my $dbh = $self->dbconnect(server =>'master',db => 'admin'); my $stmt = qq/SELECT content, DATE_FORMAT(lastupdated, '%b %e, %Y at %r') AS date FROM content/; my $content = $dbh->selectrow_hashref($stmt, undef); $template -> param( content => $content->{'content'}, date => $content->{'date'}); return $template->output; }