$Foo::Server::CALLBACK = sub { my ($server, $cgi) = @_; print "Hello " . ($cgi->param('name') || 'World') }; Foo::Server->new()->run();