use Mojolicious::Lite;
get '/tasks' => sub {
my $self = shift;
$self->stash(
tasks => [
map { [ split /\s+/ ] }
split /\n/, qx(ps axh -o comm,stat,\%cpu,nice,pid,rss,user)
]
);
} => 'tasks';
app->start('daemon');
__DATA__
@@ tasks.html.ep
%= param 'killed'
%= dumper $tasks