in reply to Excuse me, is that port taken?

Try clintp's suggestion. Or try `netstat -an`, which gives you a list of what ports are being listened to. If you want to know what process is doing the listening, take a look at lsof.

Is there some reason you can't record the binary's PID when you launch it ($! in ksh, or the return value from fork in perl, or look for a pid file somewhere), and then just check if that PID is still running (using ps with appropriate arguments, or kill 0=>$pid, or something)?