Re: Broken pipe problem? If so, why?
xhoster_at_gmail.com
Date: 03/28/05
- Next message: xhoster_at_gmail.com: "Re: A hash or array of regexp's?"
- Previous message: Big and Blue: "Re: Broken pipe problem? If so, why?"
- In reply to: malgosia askanas: "Broken pipe problem? If so, why?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Mar 2005 15:41:26 GMT
ma@panix.com (malgosia askanas) wrote:
> I have a mail-handling program written in Perl. It gets passed a mail
> message, reads the header, does some processing, and exits. The code for
> reading the header is:
>
> $/ = ''; # paragraph mode
> $header = <>;
>
> I am invoking this program in a pipe from procmail. For some messages (I
> believe, for very large ones) I get the message "Error while writing to
> <progname>" in the procmail log. I would be inclined to believe that
> it's a broken pipe problem, but if so, why does its occurrence depend on
> the message size? The program reads only the header for _all_ messages,
> independent of size - yet in a vast majority of cases, procmail does not
> complain. Can you advise?
Since your Perl program is only reading the header, it must be terminating
while there is still stuff to be read. For short messages, all that stuff
to be read fits in the buffer, so the other end of the pipe doesn't notice.
But for large messages, when the Perl end of the pipe exits the other end
of the pipe gets upset because it is now trying to write to something that
no longer exists. Or something like that.
Xho
-- -------------------- http://NewsReader.Com/ -------------------- Usenet Newsgroup Service $9.95/Month 30GB
- Next message: xhoster_at_gmail.com: "Re: A hash or array of regexp's?"
- Previous message: Big and Blue: "Re: Broken pipe problem? If so, why?"
- In reply to: malgosia askanas: "Broken pipe problem? If so, why?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|