I think from what I understand about opening pipes is that the close
statement will wait until the process has exited (one way or another) before
it will close. Could this be your problem? The close doesn't happen because
the sendmail process is still hanging around. You could always issue a kill
command to the pipe's pid before closing, however this is not something I
would recommend.
However if you are just trying to generate an email, there are 'better'
(Staying within perl, rather than using external processes - depending on
your point of view ) ways to do this. I use Net::SMT to send email. I
believe there are some Modules out there which act as a wrapper to
Net::SMTP, although I haven't used them myself. I've heard of a Mail::Sender
module, which sounds like what you would want. However Net::SMTP is simple
enough if you're sending a straight plain/text message.
Possible problems with your current method could be the number of sendmail
processes already being run? Have you exceeded a maximum and thus you're
process is actually being queued, and so doesn't end, and thus can't be
closed?
Hope this is helpful,
Marty
----- Original Message -----
From: "Ned Konz" <[EMAIL PROTECTED]>
To: "Perl-Win32-Users Mailing List"
<[EMAIL PROTECTED]>
Cc: "Perl-Win32-Users Mailing List"
<[EMAIL PROTECTED]>
Sent: Friday, May 12, 2000 4:24 PM
Subject: Re: Help! sendmail.exe won't close
> "Greenier, Allan" wrote:
>
> > open (MAIL, "|$mailprog -t") or die "couldn't open mail";
> [snip]
> > close (MAIL) or die "sendmail not close nice";
>
> There's some more diagnostics you could use. From perlipc:
>
> open(SPOOLER, "| cat -v | lpr -h 2>/dev/null")
> || die "can't fork: $!";
> local $SIG{PIPE} = sub { die "spooler pipe broke" };
> print SPOOLER "stuff\n";
> close SPOOLER || die "bad spool: $! $?";
>
> Note the handler for the SIGPIPE signal, as well as the use of $! and
> $?.
>
> --
> Ned Konz
> currently: Stanwood, WA
> email: [EMAIL PROTECTED]
> homepage: http://bike-nomad.com, Perl homepage:
> http://bike-nomad.com/perl
>
> ---
> You are currently subscribed to perl-win32-users as: [EMAIL PROTECTED]
> To unsubscribe, forward this message to
> [EMAIL PROTECTED]
> For non-automated Mailing List support, send email to
> [EMAIL PROTECTED]
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]