ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
PERL Telnet Script problem
by Saqib Rafique other posts by this author
Apr 25 2008 4:58AM messages near this date
DB_File Module not working | Re: PERL Telnet Script problem
Hi All,

Please review following code.
there is no output against the code.
the script runs and prints the starting strings and nothing more.

More over I was missing Net::Telnet module. So I downloaded it from CPAN.
Unzipped it , then I manually copied the Telnet.pm extracted from zip at
path /usr/perl5/5.00503/Net

Any help.

#!/usr/bin/perl -w
#  A TELNET SCRIPT
#
#  REMOTE TELNET FETCH UPTIME
#

#!/usr/bin/perl -w
print "***************************************\n";
print "***** A TELNET Script ******************** \n";
print "***************************************\n\n";
print "TELNET Tunnels in progress, Hold on. \n";

use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=> 10, Errmode=>'die');
$telnet-> open('xx.xx.xx.xx');
$telnet-> waitfor('/login: $/i');
$telnet-> print('root');
$telnet-> waitfor('/Password: $/i');
$telnet-> print('xxxxxxxxxx');
$telnet-> waitfor('/# $/i');
$telnet-> print('uname -a');
$output = $telnet-> waitfor('/# $/i');
print $output;


-- 
Saqib Rafique
Thread:
Saqib Rafique
Basil A. Daoust

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved