Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

use of telnet in perl

by varalaxmibbnl (Acolyte)
on Sep 13, 2013 at 07:22 UTC ( #1053852=perlquestion: print w/ replies, xml ) Need Help??
varalaxmibbnl has asked for the wisdom of the Perl Monks concerning the following question:

if i run this code i get (Can't locate Net/Telnet.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at t1.pl line 2. BEGIN failed--compilation aborted at t1.pl line 2. ) this error plz help me out to solve this problem...

#!/usr/bin/perl use Net::Telnet; $host = "xxx.xxx.xxx.xxx"; $port = "23"; $uid = "xxxxx"; $pwd = "xxxx"; open $inputLog, ">in.log"; $box = new Net::Telnet(); $box->open( Host => $host, Port => $port, ); $iLog = $box->input_log($inputLog); $flag = $box->login( Name => $uid, Password => $pwd, ); $box->print("show log"); $box->waitfor('/# $/i'); $box->close; exit

Comment on use of telnet in perl
Download Code
Re: use of telnet in perl
by rminner (Hermit) on Sep 13, 2013 at 07:49 UTC
    Sorry for this question, but did you already install Net::Telnet? Without installing it, it won't work.
    If you tell us which Unix/Linux you are trying to execute this on, then we could help you with the command for installing this module. Do you have root privileges on this machine?
    In case Net::Telnet isn't installed yet:
      thanks for ur reply... I'm working on linux ubuntu plz help me..
        Assuming you have root privileges the following command will probably work (untested):
        sudo apt-get install libnet-telnet-perl
Re: use of telnet in perl
by ansh batra (Friar) on Sep 13, 2013 at 08:26 UTC

    Can't locate Module/Name.pm in @INC
    This would always mean that the module is not installed on your machine

      always mean that the module is not installed on your machine

      ...in case there's only a single perl installation and a single user using it and in short: in case it can be ruled out that the module was installed somewhere outside the current @INC paths.

      Cheers, Sören

      Créateur des bugs mobiles - let loose once, run everywhere.
      (hooked on the Perl Programming language)

        thanks for the correction

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1053852]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (15)
As of 2014-11-24 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (142 votes), past polls