$httpd->reg_cb ( '/test' => sub { my ($httpd, $req) = @_; $t = AnyEvent->timer (after => 2, cb => sub { my $txt = "CPU info:\n\n" . `cat /proc/cpuinfo`; $req->respond ([200, "ok", { 'Content-Type' => 'text/plain' }, $txt]); }); }, );