in reply to Loading sendmail module

There is a solution in the "Perl Cookbook":

# syntax for sh, bash, ksh, or zsh $ export PERL5LIB=$HOME/perllib # syntax for csh or tcsh % setenv PERL5LIB ~/perllib

Or a solution in "Learning Perl Objects, References & Modules", which is to start your script by:

BEGIN {shift @INC, "/home/perlib";}

where perlib is always the directory that contains Mail/Sendmail.pm

--
jey

Replies are listed 'Best First'.
Re: Re: Loading sendmail module
by Anonymous Monk on Jan 29, 2004 at 17:32 UTC
    I just found an old one under Perl 5.005 directory:
    /usr/local/lib/perl5/site_perl/5.005/Mail/Mailer
    I tried calling it but gives me back an error message saying:
    Can't locate Mail/Sendmail.pm in @INC (@INC contains:.....etc..
    Here is how I did it:
    use lib '/usr/local/lib/perl5/site_perl/5.005/Mail'; use Mail::Sendmail;
    Please advise

      Try using:

      use lib '/usr/local/lib/perl5/site_perl/5.005';

      Or if it doesn't work, I would definitely advice the

      BEGIN...
      --
      jey
        Thanks I tried all this and still get same error:
        use lib '/usr/local/lib/perl5/site_perl/5.005/'; use Mail::Sendmail;
        and
        BEGIN {shift @INC, "/usr/local/lib/perl5/site_perl/5.005";} use Mail::Sendmail;
        and
        BEGIN {shift @INC, "/usr/local/lib/perl5/site_perl/5.005/Mail/Mailer"; +} use Mail::Sendmail;
        and
        BEGIN {shift @INC, "/usr/local/lib/perl5/site_perl/5.005/Mail";} use Mail::Sendmail;
        Any other suggestions?