Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, Folks. I've just start

Status
Not open for further replies.

spamfree

Programmer
Oct 25, 2002
39
IE
Hi, Folks.
I've just started using Net::Telnet to connect to connect to a terminal server. Logging on I send:
$telnet->print('Password');

To logoff I have to send 'CTRL ]'. How do I code this into PERL?

Many Thanks.
 
"CTRL+[" is a function of the standard telnet client, not of the protocol. Your Net::Telnet session will be closed for you when you call $telnet->close() or your $telnet object ceases to exist (i.e., if it is defined with "my" within a block, the connection will be closed at the end of the block).

Yours, "As soon as we started programming, we found to our surprise that it wasn't as
easy to get programs right as we had thought. Debugging had to be discovered.
I can remember the exact instant when I realized that a large part of my life
from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilk
 
Thanks for the reply.
What I should have explained, is that the 'CTRL ]' or 'CTRL X' is to logoff from the device (pbx) which is serially (RS232) connected to the Terminal server.
After logoff, I can set up a session with the next serial port (Voicemail) on the TS and poll it for alarms and so on.
After polling all ports I close the telnet session as you described.

PS: Programming, without mistakes wouldn't be any fun (challenge).

Cheers.

 
You can print a control character by preceding the character with '\c'. So '\c]' should send the correct character.

jaa
 
Fantastic! Works perfectly. And so simple.


Thanks. (I can get thet raise now)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top