0

I've the following requirement: 1) telnet to machine x on telnet port. 2) once you are in machine x, telnet to machine y on a different port. 3) now issue the commands to machine y and get the output.

I cannot use expect on both these machines.

How do i achieve this in perl? I should be able to read the output of commands issued to machine y by being in machine x.

Thanks in advance.

BoCode
  • 847
  • 4
  • 17
  • 33
  • 1
    What have you tried so far and what are the problems you are having currently with your code ? – Prix May 10 '11 at 12:16

1 Answers1

0

The CPAN Net::Telnet module should help you here, at least in your first step to machine x.

You may end up writing code to sit on machine x that uses Net::Telnet that you run via your connection to machine x.

Without a lot more information on your curennt probelms that's the best I can do, sorry.

Rich Parker
  • 172
  • 5
  • Great! Thanks for the info. I've written code to telnet to the machine x and from there on, am issuing telnet >machine y> from the telnet prompt. But i get a "connection refused" message. – BoCode May 10 '11 at 16:02
  • ..continuation from the previous message: But I try doing this manually, i get connected to machine y without any issues. What could be the problem? – BoCode May 10 '11 at 16:03