http://www.perlmonks.org?node_id=647492


in reply to Stopping an HTTP::Server::Simple server

I've done something similar in the time before HTTP::Server::Simple with Test::HTTP::LocalServer.

I use a special URL to tell my server that I'm done with it, normally /quit.

As I launch the server as a child process, I have it output the URL where it can be found, so I get an "always unused port" there.

As an aside, why are you launching a server at all, when you can just require the server module and call the ->handler() or ->handle_request() yourself?