xeronuro
11/16/2012 - 1:35 AM

gistfile1.pl

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