Help with Net::Telnet perl module

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abdulbca
    New Member
    • Apr 2010
    • 1

    Help with Net::Telnet perl module

    Hi,

    I am trying to execute a simple perl script, i have installed net::telnet module.
    I have many perl scripts and all are running fine, except this first perl script i m trying to write for net telnet module.

    =============== =============
    Net::Telnet module status

    Sat Dec 19 14:21:40 2009: "Module" Net::Telnet
    "installed into: /usr/lib/perl5/site_perl/5.8.5"
    "LINKTYPE: dynamic"
    "VERSION: 3.03"
    "EXE_FILES: "
    =============== =============

    Perl version is perl v5.8.5

    =============== ====
    #!/usr/bin/perl -w

    use Net::Telnet;
    =============== ====
    Error:
    -------
    [root@localhost abdul]# ./testnettelnet.p l
    ./testnettelnet.p l: line 4: use: command not found
    ./testnettelnet.p l: line 5: use: command not found
    [root@localhost abdul]#

    I have to telnet to any of my router or switch .. but the program is givng the above error, i am new to this perl and net telnet module.

    Regards
    Abdul
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    Looks like your shebang line is wrong and your default shell (probably sh) is trying to execute the script instead of perl.

    Comment

    Working...