$pid = $array[1] if (foreach(@line = `/usr/bin/ps -ux`){$_=~ /hoge\.pl/;@array = map {split} $_;}); $kill = `kill $pid`;