Hi,
I am using this module (Net::Telnet) downloaded from CPAN, for a small
interactive program in which I telnet to a particular host, login and give
some commands (based on the options you get). I am not able to do this. I am
able to login but whatever I do after that doesn't seem to happen. Can
someone suggest what might be going wrong!!!
After login, the control console shows
------- Control Console
-------------------------------------------------------
1- Device Manager
2- Network
3- System
4- Logout
<ESC>- Main Menu, <ENTER>- Refresh, <CTRL-L>- Event Log
>
Please let me know your inputs.
<<Test.txt>>
Thanks & Regards,
Rajesh.
**********************************************************************
The information contained in this email and any attachments
is likely to be confidential and legally privileged, and is for the
intended recipient named above only. Any copying,
dissemination, disclosure of or use of this email or its
attachments unless authorised by us is prohibited, except
that you may forward this email and/or attachments to a third
party on a strict "need to know" basis.
If you have received this email in error, please notify us
immediately by replying to the email or by calling
+91-80-22297030. Please then delete this email and any full
or partial copies of it.
You as the intended recipient must be aware and accept
that emailis not a totally secure communications medium.
Although we have taken all reasonable steps to make
sure this email and any attachments are free from viruses,
we do not (to the extent permitted by law) accept any liability
whatsoever for any virus infection and/or compromise of
security caused by this email and any attachment.
No contract may be formed or documents served by you
on or with us by this email or any attachments unless
expressly agreed otherwise by us.
Any views expressed in this email or attachments by
an individual are not necessarily those of UbiNetics
India (Private) Limited.
**********************************************************************
print "I am starting my script\n";
use Net::Telnet;
my $t = new Net::Telnet (Timeout => 10,
Prompt => '/bash\$ $/');
my $username = "apc";
my $passwd = "apc";
$t->open("192.168.0.15");
print "I got connected\n";
$t->waitfor('/User Name :.*$/');
$t->print("$username\n");
$t->waitfor('/Password :.*$/');
$t->print("$passwd\n");
print "I have logged in\n";
sleep(2);
$t->print("1");
print "This is first step\n";
sleep(2);
$t->print("3");
print "This is second step\n";
sleep(2);
$t->print("1");
print "This is third step\n";
sleep(2);
$t->print("1");
print "This is fourth step\n";
sleep(2);
$t->print("3");
print "This is fifth step\n";
sleep(2);
$t->print("YES");
print "This is sixth step\n";
sleep(2);
$t->print("");
print "This is seventh step\n";
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs