open() and pipes

Uri Guttman uri at stemsystems.com
Tue Aug 1 17:31:08 BST 2006


>>>>> "DC" == David Cantrell <david at cantrell.org.uk> writes:

  DC> I know that you can't do this ...
  DC>   open(FOO, '|program|')

  DC> It just seems odd to me that this functionality is missing and that you
  DC> need to use a module for it.  Given that IPC::Open2 was bundled with the
  DC> very first version of perl5, it seems odd that that functionality wasn't
  DC> just rolled into open() at that time.

  DC> Am I missing something obvious?

yes, 1 handle vs 2.

open only takes one handle for an argument and pipe needs two handles
(for parent and child after forking).

and if you want to handle stderr you need a third handle (hence
ipc::open3).

uri

-- 
Uri Guttman  ------  uri at stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


More information about the london.pm mailing list