in reply to Using Sendmail.pm problem
$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.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Sendmail.pm problem
by tariqahsan (Beadle) on Sep 22, 2006 at 14:43 UTC | |
by davorg (Chancellor) on Sep 22, 2006 at 14:48 UTC | |
by tariqahsan (Beadle) on Sep 22, 2006 at 15:08 UTC | |
by VSarkiss (Monsignor) on Sep 22, 2006 at 17:23 UTC | |
by tariqahsan (Beadle) on Sep 22, 2006 at 21:55 UTC | |
| |
by davorg (Chancellor) on Sep 22, 2006 at 15:17 UTC |