<html>
<body>
Hi All<br>
I have a small perl script called "male" which is used in much
the same way, with similar options as "mail". <br>
That is you can do things like <tt>echo"boo" | mail
spike@mweb.com<br>
</tt>But male allows a few extra options that I find useful like you can
set the reply address and Cc etc from the Command line too. i.e <tt>cat
myfile.txt | male -c cc@mweb.com -r sender@spam.com
spike@mweb.com<br><br>
</tt>The most useful bit being the -a that allows me to send a file as an
attachment. Now this is where my problem is. It all works fine as long as
I <tt>cat myfile | male</tt> .... or <tt>echo"my message
to you" | male</tt> ......<br><br>
But often I don't want to send a message body - i just want to send an
attached file. <tt>male -a myfile
spike@mweb.com<br><br>
</tt>The problem is that it just hangs waiting for something on
STDIN.<br><br>
I capture the STDIN with <br><br>
while (<STDIN>)<br>
{<br>
<x-tab> </x-tab>$body .=
$_;<br>
}<br><br>
In have also tried <br><br>
@body = <STDIN>;<br><br>
and <br><br>
if(<STDIN>)<br><br>
but as soon as we get a <STDIN> it waits for one!<br><br>
Anyone have an idea on how I can get the script to realize when there
will be no STDIN - (other than another switch on the Command line)?<br>
</body>
</html>