Also, is port forwarding enabled in server A?
In reply to Re: How to open nested SSH connection using perl by salva in thread How to open nested SSH connection using perl by gjoshi