Agreed.

As for the $pid identifier, myggan wrote one on mircscripts.org.