If all you are trying to do is knock down a bunch of remote commands, you can just use perl. You can open the ssh command and pass the results back to perl. (Of course, you need to configure the keys for access without a password)
open (REMOTE, "ssh user@hostB \"myScript\"|");
while (<REMOTE>)
{
print $_;
}
. , .