For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > June 2005 > open() to unix command









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author open() to unix command
Manav Mathur

2005-06-08, 3:57 am


Hi all,
In the usual case when we code something like
<code>
open(TO_PIPE,"| sendmail blah blah") or die("$! : fork failed") ;
##do something here
close(TO_PIPE) or die("$! : bad sendmail") ;
</code>

What does perl do when it encounters the open() and the close() statements??
Especially, why can an error in sendmail can only be caught in close() and
not in open() ??

Manav


****************************************
*****************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s)
. In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except wh
ere the sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its us
e

****************************************
*****************
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com