in reply to How to kill an external program

Not sure quite what you mean, but would the Proc::Simple module be of use?
$xterm = Proc::Simple->new(); $xterm->start("xterm -sb -ls -vb"); ... $xterm->kill();