#!/opt/perl/bin/perl
use AnyEvent;
use BS::HTTPD;

my $cvar = AnyEvent->condvar;

my $httpd = BS::HTTPD->new (port => 9090);

$httpd->reg_cb (
   _ => sub {
      my ($httpd, $req) = @_;

      $req->respond ({ content => ['text/html', <<'CONT']});
         <html><body><h1>Hello World!</h1>
         <a href="/test">another test page</a>
         </body></html>
CONT
   },
   _test => sub {
      my ($httpd, $req) = @_;

      $req->respond ({ content => ['text/html', <<'CONT']});
         <html><body><h1>Test page</h1>
         <a href="/">Back to the main page</a>
         </body></html>
CONT
   },
);

$cvar->wait;
