ok, per the instructions, binmode only converts CR LF to \n, which is not what i'm looking for.
Out of curiousity isn't the escape character used for client side handling? In this case why would you need to worry about the escape character, as you can drop to a subshell from within Perl, and since this is talking directly to a telnet session it doesn't really make since to drop to a subshell, as that subshell would be your Perl script???
here is a condensed version of the script:
###############
#!/usr/bin/perl
use ASI::WebDB; use Term::ReadKey; use Net::Telnet ();
my $login = ""; my $securid = "";
print "UID: "; chomp($login = <>); ReadMode noecho; print "SECURID: "; chomp($securid = <>); ReadMode restore;
$t = new Net::Telnet (Timeout => 10);
$t->open("x.x.x.x");
print "\nlogging in to system"; &login_system;
sub login_system { my ($prematch, $match) = $t->waitfor(String => "login:", Errmode => 'return'); print "$prematch $match\n\n"; print "\nchanging \"escape\" character"; print "\n"; $t->put("^]");
My first guess is that the above is sending '^' and then ']' instead of the control charactert that you want. So you should convert the above to the hex representation of the character so Perl knows what you are really talking about, or use the Ctrl+V Ctrl+] sequence.
($prematch, $match) = $t->waitfor(String => "telnet", Errmode => 'return'); print "$prematch $match\n\n"; print "\nback in telnet"; print "\n"; $t->print("set escape ^["); $t->waitfor(String => "escape character is '^['."); $t->print (""); $t->waitfor(String => "login:", Errmode => 'return'); print "\nEntering stoak account login"; $t->print("$login");
$t->waitfor(String => "PASSCODE:", Errmode => 'return'); print "\nEntering SECURID PASSCODE"; $t->print("$securid"); }
##############
i get "pattern match timed-out at ./script-name line 102" which is
$t->waitfor(String => "escape character is '^['.");
so escaping back to the normal telnet prompt to change the escape character doesn't work. a normal telnet "escape" character is ^] ... i need to know how to change that from ^] to ^[ (or ^A or whatever) within net::telnet
again, tia for any help joe
Did you turn on the debugging switch?
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>