<html>
<body>
Hi All<br>
I have a small perl script called &quot;male&quot; which is used in much
the same way, with similar options as &quot;mail&quot;. <br>
That is you can do things like <tt>echo&quot;boo&quot; | 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&nbsp; <tt>cat myfile | male</tt> ....&nbsp; or <tt>echo&quot;my message
to you&quot; | male</tt> ......<br><br>
But often I don't want to send a message body - i just want to send an
attached file.&nbsp;&nbsp;&nbsp; <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 (&lt;STDIN&gt;)<br>
{<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>$body .=
$_;<br>
}<br><br>
In have also tried <br><br>
@body = &lt;STDIN&gt;;<br><br>
and <br><br>
if(&lt;STDIN&gt;)<br><br>
but as soon as we get a &lt;STDIN&gt; 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>