The lessons I learned from setting up an API server via perl script
Problem Statement Recently When I was trying to set up an API server in a perl script to do some unit tests, I met lots of trouble. In conclusion, the trouble can be classfied as 3 parts: The residual server processes can’t be killed properly. Program stucked after launch the API server. stdin, stdout, stderr on windows. Error examples The residual server processes can’t be killed. 1 system(perl server.pl daemon -l http://*:0); Use the command above in main test script will launch an API server in a child process. The residual server processes should be killed without any left after the tests. At first I use “system” to run the command, and then kill it in a different system command via: ...