Re: Mail Tools 1.74 installs but get error



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@xxxxxxxxxxxxxx');
$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/

.



Relevant Pages

  • Re: Mail Tools 1.74 installs but get error
    ... Can't locate object method "send=hash" via package ... line 22, <VAULT> line 2318518. ... $msg = new Mail::Send ... open file to mail: $!"; ...
    (comp.lang.perl.modules)
  • Is this a bug?
    ... results in the error message ... catch {package require notFound} msg ... It appears the global msg and the::foo msg ...
    (comp.lang.tcl)
  • Re: Rename Problem
    ... PACKAGE transmit_message IS ... msg: signals RENAMES m1.signals_record; ... Jeff Carter ...
    (comp.lang.ada)
  • CTAN package upgrade: msg V 0.40
    ... document class or package. ... obtain messages in their own prefered language. ... report any pb. ... no options are declared and processed when the "msg" ...
    (comp.text.tex)
  • Re: Rename Problem
    ... If you want to rename a component of msg, msg say, ... PACKAGE BODY transmit_message IS ... data1: boolean; ... msg: signals RENAMES m1.signals_record; ...
    (comp.lang.ada)