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

Dear All, I am using Perl 5.005_03 on SuSE Linux 7.0, and need to use the Net::SMTP module. The module wasn't present so I downloaded it from CPAN and installed as per the readme file(perl Makefile.PL, make, make test, make install all as root). It appeared to work OK but now when I try to use Net::SMTP in a script the interpreter returns: Can't locate object method "new" via package "Net::SMTP" Are there some post-install configuration requirements I'm missing? If anybody has any ideas about what the problem might be, the advice would be very much appreciated. Thanks. Austin.

Replies are listed 'Best First'.
Re: Net::SMTP installed OK?
by Fletch (Bishop) on Nov 16, 2001 at 17:55 UTC

    Run the following at your shell prompt:

    perl -MNet::SMTP -e 0

    If that doesn't produce any errors, it's installed correctly. If it does gripe, it didn't. If it is installed correctly, make sure you've got use Net::SMTP (); near the top of your program.

Re: Net::SMTP installed OK?
by mce (Curate) on Nov 16, 2001 at 18:15 UTC
    Hi,
    I don't see why use Net::SMTP; needs the (). This is not mentioned in the pod of Net::SMTP (version 2.5).
    Since make test was ran successfull, you package is installed OK. But, I cannot make out what you actually installed. Net::SMTP cannot be installed seperately, you need libnet-1.09.
    Can you please check that your PERLLIB is set correctly, and post some code you have tried?
    Have a look at the file PERLLIB/site/lib/Net/SMTP.pm , and check if it is complete.
    ---------------------------
    Dr. Mark Ceulemans
    Senior Consultant
    IT Masters, Belgium
Re: Net::SMTP installed OK?
by MZSanford (Curate) on Nov 16, 2001 at 19:09 UTC
    hmmm, i think your problem is described here. Can't locate method "new" usually means the <code lang="perl">use Net::SMTP</code> is missing. I have done this more times than i would like to admit.
    i had a memory leak once, and it ruined my favorite shirt.