I don't think this is possible. You are expecting the second telnet session to be handled by Net::Telnet. It won't.
The reason is that you are running telnet as a command line tool over Net::Telnet's telnet session. Net::Telnet doesn't know that the second telnet session exists. All it knows is that you sent some keystrokes to the remote server. The remote server is the one initiating and managing the telnet session.
In reply to Re: How do I telnet into a machine and then to a third one?
by Marza
in thread How do I telnet into a machine and then to a third one?
by smoss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |