On Tuesday 05 November 2002 5:47 pm, Kipp, James wrote:
> > Hello everyone,
> >
> > I'm trying to use the Mail::Sendmail module in a script where I need a
> > independent mailer. The problem I'm having is including more
> > than one line
> > of text in the message body. I'm not really sure how to do this. The
> > package uses a $mail{message} = "blah" var for the message
> > body. Is it
> > possible to get more than one line into that hash value?
>
> $mail{message} = "this is a line\nthis is another\n"
>
> > Basically I've got a script that generates a bunch of information and
> > outputs it to a file. What I would like to do is make the
> > contents of this
> > file, the body of my message. I don't want it as an attachment.
>
> how about:
> my $body = `cat $yourfile`;
Always try to do things within perl. Using the backticks to system() the
external cat command will work only if the cat command exists and is in the
$PATH. Also, it is less efficient as it involves forking another process and
execing another file.
While this may not matter in a 10 line prog, it will hit performance big time
if it's inside a loop handling a directory with 1000s of files in.
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]