>>>>> "HP" == Harry Putnam <[email protected]> writes:

  HP>     open(SENDMAIL,"|$sendmail $recip")  or die "Can't open <$sendmail>: 
$!";
  HP>     while (<SENDMAIL>) { 

what is that line supposed to do? it reads from the SENDMAIL handle
which is opened for WRITING. why do you think you need that or even to
loop over that handle? just print to it.

and yes, this is garbage code. there are many easy to use mail modules
that will use sendmail or any available mail service for you.

  HP>       print SENDMAIL "$emailmsg\n";
  HP>       print "$emailmsg\n";
  HP>     }
  HP>     close(SENDMAIL);

when you open a piped process, check the close as that is where you will
actually find any errors from the open. since open | does a fork/exec,
it can't tell you if the exec fails until you close the handle.

  HP>   } else {

why the else? $MAIL is 'TRUE' so this will never execute.

  HP>     for (@body) {
  HP>       print "$_\n";
  HP>     }


uri

-- 
Uri Guttman  ------  [email protected]  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to