in reply to regarding perl thread

The error is caused by the line:
$th.=$i; # $th is "threads=SCALAR(0x81e2d50)", so you see "threads=SCA +LAR(0x81e2d50)0"
I'm not sure what that line is doing here, it doesn't make sense to me.