$home = $ENV{"HOME"};
BEGIN { push @INC, "$home/scripts/Mail" };
use Mail::Sendmail;

This all looks rather dodgy. The variable $home doesn't get given a value until runtime, but you try to access it in a BEGIN block which is executed at compile time (i.e. before $home has a value). I think you'd be better off using:

use lib "$ENV{HOME}/scripts/";

I've left off the "Mail" from that path as because it's part of the module name, you don't need it in the library path.

I'm also a bit dubious about how you installed the module. Creating directories and copying files around is prone to failure. I'd really recommend that you did it again using the standard "perl Makefile.PL / make / make test / make install" commands. I realise that you don't have permission to install modules into the central library, but you can pass arguments to "perl Makefile.PL" to get round that.

Having said all that, I'm surprised by the error message you get. I would expect you to see an error saying that the module couldn't be loaded successfully.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg


In reply to Re: Using Sendmail.pm problem by davorg
in thread Using Sendmail.pm problem by tariqahsan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.