Click here to get back home

Mail Tools 1.74 installs but get error

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Mail Tools 1.74 installs but get error jesse 02-19-2007
Posted by jesse on February 19, 2007, 1:33 pm
Please log in for more thread options


I have installed Mail Tools 1.74. I have also tried to use it in a
scripts but it bombs with this message.

Reference found where even-sized list expected at /usr/perl5/site_perl/
5.6.1/Mail/Send.pm line 17, <VAULT> line 2318518.
Can't locate object method "send=hash(0x157a04)" via package
"mail::send=hash(0x157a04)" at /usr/perl5/site_perl/5.6.1/Mail/Send.pm
line 22, <VAULT> line 2318518.

This is how I'm using the module.

require Mail::Send;
my $MDATE = time2str("%m%d%y", time);

my $msg;
my $fh;
$msg = new Mail::Send

$msg = new Mail::Send Subject=>'Netbackup Logs', To=>'Storage';

$msg->to('jesse_hardy@premierinc.com');
$msg->subject('Netbackup Logs');


$fh = $msg->open("/export/home/jhardy/errors/log.$MDATE")or die "Can't
open file to mail: $!";
print $fh;
$fh->close;

Any help would be greatly appreciated.

Thanks,
Jesse


Posted by Mumia W. on February 19, 2007, 3:17 pm
Please log in for more thread options


On 02/19/2007 12:33 PM, jesse wrote:
> I have installed Mail Tools 1.74. I have also tried to use it in a
> scripts but it bombs with this message.
>
> Reference found where even-sized list expected at /usr/perl5/site_perl/
> 5.6.1/Mail/Send.pm line 17, <VAULT> line 2318518.
> Can't locate object method "send=hash(0x157a04)" via package
> "mail::send=hash(0x157a04)" at /usr/perl5/site_perl/5.6.1/Mail/Send.pm
> line 22, <VAULT> line 2318518.
>
> This is how I'm using the module.
>
> require Mail::Send;
> my $MDATE = time2str("%m%d%y", time);
>
> my $msg;
> my $fh;
> $msg = new Mail::Send
>
> $msg = new Mail::Send Subject=>'Netbackup Logs', To=>'Storage';
>
> $msg->to('jesse_hardy@premierinc.com');
> $msg->subject('Netbackup Logs');
>
>
> $fh = $msg->open("/export/home/jhardy/errors/log.$MDATE")or die "Can't
> open file to mail: $!";

It seems that you're supposed to give "open" the name of one of the
$type options for Mail::Mailer->new.


> print $fh;
> $fh->close;
>
> Any help would be greatly appreciated.
>
> Thanks,
> Jesse
>

use File::Slurp qw(slurp);
...
$fh = $msg->open; # The default mailing method is probably good.
print $fh slurp("/export/home/jhardy/errors/log.$MDATE");
$fh->close;

WARNING: UNTESTED CODE

--
Windows Vista and your freedom in conflict:
http://www.badvista.org/


Posted by jesse on February 20, 2007, 8:54 am
Please log in for more thread options


On Feb 19, 3:17 pm, "Mumia W." <paduille.4060.mumia.w
+nos...@earthlink.net> wrote:
> On 02/19/2007 12:33 PM, jesse wrote:
>
>
>
>
>
> > I have installed Mail Tools 1.74. I have also tried to use it in a
> > scripts but it bombs with this message.
>
> > Reference found where even-sized list expected at /usr/perl5/site_perl/
> > 5.6.1/Mail/Send.pm line 17, <VAULT> line 2318518.
> > Can't locate object method "send=hash(0x157a04)" via package
> > "mail::send=hash(0x157a04)" at /usr/perl5/site_perl/5.6.1/Mail/Send.pm
> > line 22, <VAULT> line 2318518.
>
> > This is how I'm using the module.
>
> > require Mail::Send;
> > my $MDATE = time2str("%m%d%y", time);
>
> > my $msg;
> > my $fh;
> > $msg = new Mail::Send
>
> > $msg = new Mail::Send Subject=>'Netbackup Logs', To=>'Storage';
>
> > $msg->to('jesse_ha...@premierinc.com');
> > $msg->subject('Netbackup Logs');
>
> > $fh = $msg->open("/export/home/jhardy/errors/log.$MDATE")or die "Can't
> > open file to mail: $!";
>
> It seems that you're supposed to give "open" the name of one of the
> $type options for Mail::Mailer->new.
>
> > print $fh;
> > $fh->close;
>
> > Any help would be greatly appreciated.
>
> > Thanks,
> > Jesse
>
> use File::Slurp qw(slurp);
> ...
> $fh = $msg->open; # The default mailing method is probably good.
> print $fh slurp("/export/home/jhardy/errors/log.$MDATE");
> $fh->close;
>
> WARNING: UNTESTED CODE
>
> --
> Windows Vista and your freedom in conflict:http://www.badvista.org/- Hide
quoted text -
>
> - Show quoted text -

Thanks that seems to have fixed the problem.


Similar ThreadsPosted
Net::SMTP error: Can't locate Mail/Sender.pm in @INC May 19, 2005, 10:33 am
Mail:Sender - HTML Mail with alternatives problem July 21, 2004, 6:44 pm
CPAN, packaging tools, META.yml August 17, 2005, 1:22 pm
Problem with MIME-tools 5.414 not finding encode_qp October 27, 2004, 8:00 pm
ISO: deep voodoo debugging tools for tracking down seriously weird module behavior. November 9, 2007, 1:28 pm
Error: RCPT TO: error (550 relay not permitted) February 11, 2006, 1:39 pm
Mail::Audit help plz October 26, 2005, 8:18 pm
GD.c: 533: error: syntax error before "void" March 24, 2006, 10:15 am
Mail::Vacation abondoned? August 11, 2004, 3:13 pm
Mail::Audit Question August 30, 2004, 12:55 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap