Hi there,
At work i want to query a results server.
I have a simple perl telnet module that can log into the server but it stops receiving data after logging in.
Waitfor() times out
Getline() receives nothing extra
Here is my code:
use Net::Telnet ();
$host = "x.x.x.x";
$username = "xxx";
$passwd = "xxxxxxx";
$t = new Net::Telnet (Timeout => 10,
Dump_Log => "dump.txt",
Input_Log => "in.txt",
Output_Log => "out.txt",
Prompt => '/$/');
$t->open($host);
$t->login($username, $passwd);
print $t->getline();
$t->waitfor('/Select Option : ?$/i');
$t->print("1");
Here is my dumpfile
< 0x00000: ff fb 01 ff fb 03 ÿû.ÿû.
> 0x00000: ff fd 01 ff fd 03 ÿý.ÿý.
< 0x00000: 0d 0a 0d ...
< 0x00000: 0a 57 65 6c 63 6f 6d 65 20 74 6f 20 4f 70 65 6e .Welcom
+e to Open
< 0x00010: 56 4d 53 20 41 6c 70 68 61 20 76 65 72 73 69 6f VMS Alp
+ha versio
< 0x00020: 6e 20 56 37 2e 33 2d 31 20 20 0d 0a 0d 0a 0d 55 n V7.3-
+1 .....U
< 0x00030: 73 65 72 6e 61 6d 65 3a 20 sername
+:
> 0x00000: 69 63 75 0d 0a icu..
< 0x00000: 69 i
< 0x00000: 63 75 0d 0a 0d 50 61 73 73 77 6f 72 64 3a 20 cu...Pa
+ssword:
> 0x00000: 69 63 75 31 32 33 34 0d 0a icu1234
+..
< 0x00000: 0d 0a 20 20 20 57 65 6c 63 6f 6d 65 20 74 6f 20 .. We
+lcome to
< 0x00010: 4f 70 65 6e 56 4d 53 20 28 54 4d 29 20 41 6c 70 OpenVMS
+ (TM) Alp
< 0x00020: 68 61 20 4f 70 65 72 61 74 69 6e 67 20 53 79 73 ha Oper
+ating Sys
< 0x00030: 74 65 6d 2c 20 56 65 72 73 69 6f 6e 20 56 37 2e tem. Ve
+rsion V7.
< 0x00040: 33 2d 31 20 6f 6e 20 6e 6f 64 65 20 52 47 4c 41 3-1 on
+node RGLA
< 0x00050: 42 32 0d 0a 0d B2...
< 0x00000: 20 20 20 20 4c 61 73 74 20 69 6e 74 65 72 61 63 Las
+t interac
< 0x00010: 74 69 76 65 20 6c 6f 67 69 6e 20 6f 6e 20 46 72 tive lo
+gin on Fr
< 0x00020: 69 64 61 79 2c 20 32 35 2d 4f 43 54 2d 32 30 31 iday. 2
+5-OCT-201
< 0x00030: 33 20 31 37 3a 33 37 3a 30 37 2e 32 35 0d 1b 5b 3 17:37
+:07.25..[
< 0x00040: 63 c
< 0x00000: 1b 5c 1b 5a .\.Z
< 0x00000: 1b 5b 30 63 .[0c
This is what i see when i just manually enter a telnet session
Welcome to OpenVMS Alpha version V7.3-1
Username: icu
Password:
Welcome to OpenVMS (TM) Alpha Operating System, Version V7.3-1 on n
+ode RGLAB2
Last interactive login on Friday, 25-OCT-2013 17:44:22.40
1 A Live APEX System
2 T Training APEX System
3 S Old Biochemistry Data (up to 9th May 1999)T
4 P Change Password
5 Q Quit/Logout
Select Option :
Im guessing its a prompt issue. But ive no idea what my prompt should be.
Ive tried switching telnetmode, binmode but no luck
Any ideas?
Thank you...