mizmaster22 has asked for the wisdom of the Perl Monks concerning the following question:

I am using the Padre IDE to compile/run my scripts. Everything was going great with it I had a script using the package Net::Telnet to login to my telnet system and retrieve data and whatnot and it was working great. I then decided to create an .exe file out of my script and got the great idea to use perl2exe. Well, when I began to use it, it told me that it did not support my version of Perl, so I then downgraded. The downgrade did not go very well, so I then reinstalled strawberry perl plus padre and now it is not recognizing my script that was working great before I reinstalled. The error I am receiving is "Can't locate object method "new" via package "Net::Telnet" <perhaps you forgot to load "Net::Telnet"?>". I already put the telnet.pm file into the directory where I put strawberry perl plus padre. Any ideas? Also, I have posted here before and you guys have been awesome. Thanks for the help, I appreciate it.

Replies are listed 'Best First'.
Re: Net::Telnet Padre Error
by davido (Cardinal) on Jun 17, 2011 at 16:55 UTC

    From the command line type cpan Net::Telnet

    App::Cpan (the cpan program) installs modules for you. Since you're using Strawberry Perl, it should work for you. You may also want to install (and use in the future) App::cpanminus. It's a little easier to use but less flexible.

    You can't just put the module into the Perl binary folder and have it work. Perl doesn't look there for it.

    Typing perl -V (capital V) from the command line will give a bunch of information, including where Perl looks for modules. (The contents of @INC)


    Dave

Re: Net::Telnet Padre Error
by 7stud (Deacon) on Jun 17, 2011 at 16:59 UTC

    But the op isn't getting the error:

    Can't locate Net/Telnet.pm in @INC

    Op, what do your use statements look like?

      use Net::Telnet ();

      $pop = new Net::Telnet (Telnetmode => 1, Input_log => $file, dump_log => $file1);

        Try rewriting that as:
        use Net::Telnet; my $pop = Net::Telnet->new(Telnetmode => 1, Input_log => $file, dump_l +og => $file1);
        HTH,

        Paul