Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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/ 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 line 2. BEGIN failed--compilation aborted at line 2. ) this error plz help me out to solve this problem...

#!/usr/bin/perl use Net::Telnet; $host = ""; $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

Replies are listed 'Best First'.
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/ 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 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1053852]
Approved by Corion
[1nickt]: ... the end of the afternoon. marto How are you, snowed in? Mum and Dad expecting snow today in Surrey. (Have 5" on the ground here in NJ. And my son's high school in SOCal closed until after Xmas due to fires.)
[Corion]: 1nickt: In a sense the meta-bullshit might even be beneficial to you as you get to hear the cow-orkers talk (or not talk) about the issues you perceive. I think Agile is mostly about the meta ;)
[Corion]: 1nickt: On Sunday maybe 10cm of snow fell, and the airport closed, and the trains stopped running etc :) It always comes as a surprise that snow falls here during the winter...
[marto]: 1nickt, no snow, just some ice on the roads and the usual idiocy associated with humans and driving in less than ideal conditions

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-12-11 11:52 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (289 votes). Check out past polls.