[asterisk-users] carefulwrite: write() returned error:Brokenpipe

Danny Nicholas danny at debsinc.com
Thu Oct 22 13:53:14 CDT 2009


For my (and any other lazy watchers) benefit, would you post how you would
do my snippet in C?

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Steve Edwards
Sent: Thursday, October 22, 2009 1:48 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] carefulwrite: write() returned
error:Brokenpipe

On Thu, 22 Oct 2009, Danny Nicholas wrote:

> So this would actually be proper?

[snip]

>> my $envvars = <STDIN>;

I don't "do" Perl, but if that statement reads everything buffered on 
STDIN -- i.e., the AGI environment, then I would guess it would work.

"Proper" would be to read and parse the environment "properly." You could 
make the argument that since you're not going to use anything from the AGI 
environment, why waste the cycles.

I would counter that "best practice" would be to read and parse the 
environment as well as setting up a SIGHUP handler, initializing syslog(), 
setting a STATUS channel variable to FAILURE (and setting it to SUCCESS 
upon successful completion), etc., etc., etc.

I find that "feeping creaturism" is easier to deal with if you start with 
a good framework.

I could have said something about using a "real" language like C so you 
could do everything you want and be finished way before you could even 
load the Perl interpreter but I don't feel like ducking :)

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list