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


in reply to (code) Check for particular services running on remote WinNT host(s)

To protect against output getting out of order if something invoked by system() chokes, adding $|++; to the top of the script is a good idea.