5 my $cvar = AnyEvent
->condvar;
7 my $httpd = BS
::HTTPD
->new (port
=> 9090);
11 my ($httpd, $req) = @_;
13 $req->o ("<html><body><h1>Testing return types...</h1>");
14 $req->o ("<img src=\"/image/bshttp.png\" />");
15 $req->o ("</body></html>");
18 '_image_bshttp.png' => sub {
19 open IMG
, 'bshttp.png'
20 or do { $_[1]->respond (
21 [404, 'not found', { 'Content-Type' => 'text/plain' }, 'Fail!']);
23 $_[1]->respond ({ content
=> [ 'image/png', do { local $/; <IMG
> } ] });