Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: how to exec() with my filehandles !

by ikegami (Pope)
on May 21, 2010 at 20:48 UTC ( #841128=note: print w/replies, xml ) Need Help??


in reply to [Resolved] how to exec() with my filehandles !

If i post here, this is because i want to make a sub which execute some file (or a perl sub), and returns a 4 elements list : the child pid, the in, out and stderr filehandles the function generates

That describes IPC::Open3's open3 almost exactly. Here's a simple wrapper that provides the desired interface:

use IPC::Open3 qw( open3 ); sub create_child { my $pid = open3( local *TO_CHLD, local *FR_CHLD, local *FR_CHLD_ERR, @_ ); return ( $pid, *TO_CHLD, *FR_CHLD, *FR_CHLD_ERR ); }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://841128]
help
Chatterbox?
and the grasshoppers chirp...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2018-07-20 12:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (431 votes). Check out past polls.

    Notices?