Skip to content

Instantly share code, notes, and snippets.

@sharifulin
Created August 19, 2011 16:32
Show Gist options
  • Save sharifulin/1157271 to your computer and use it in GitHub Desktop.
Save sharifulin/1157271 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment