The value for the hash-key 'Subject' should be a scalar such as a number or
string. It shouldn't be a 'print' statement. Just use the substr() which
returns a string.
%mail = ( To => '[EMAIL PROTECTED]',
From => '[EMAIL PROTECTED]',
Subject => substr($line, 43, 7)
Message => 'Test message'
);
Sathish
-----Original Message-----
From: KeN ClarK [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 11:26 AM
To: Lance Prais
Cc: [EMAIL PROTECTED]
Subject: Re: Output to email
you have the option of searching via nntp or the web-based list for old
messages at http://nntp.perl.org/group/perl.beginners/
of course, that's how i spend my time, since i'm very NEW, and hence don't
know the answer to your ?...
k
On Fri, 28 Dec 2001, Lance Prais wrote:
>
> I am sorry I asked this question a while back but my computer crashed and
> lost all my documentation.
>
>
> I am trying to output text from a doc. that I am reading to an email I am
> sending but it is not working.
>
> Here is my code:
>
> print STDERR "\nline: ", substr($line, 43, 7); ---This outputs the
word
> "Running" as it should
>
> use Mail::Sendmail; #Send and email if there are
errors
> %mail = ( To => '[EMAIL PROTECTED]',
> From => '[EMAIL PROTECTED]',
> Subject => print STDERR "\nline: ", substr($line, 43,
> 7),----This outputs "1" WHY?
> Message =>
> );
> sendmail(%mail) or die $Mail::Sendmail::error;
> print "OK. Log says:\n", $Mail::Sendmail::log;
>
> Thank you to everyone that has been helping me with this first of many
> scripts. It has definitely been a learning experience
>
>
>
KeN
_____________________________________
http://quantifier.org GnuPG: 7C828670
2:15pm up 7 days, 22:01
You are so boring that when I see you my feet go to sleep.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]