Questions tagged [ipcopen3]

Questions related to the perl IPC::Open3 module

This standard perl module provides a way to run a process while specifying its standard input, output and error streams.

20 questions
5
votes
3 answers

Use IPC::Open3 with perlcritic

I want to supress output in child process and read only stderr. perlfaq8 advises to do following: # To capture a program's STDERR, but discard its STDOUT: use IPC::Open3; use File::Spec; use Symbol qw(gensym); open(NULL, ">",…
Andrey Starodubtsev
  • 5,139
  • 3
  • 32
  • 46
5
votes
2 answers

Simple open3 example not working

I am trying to make a Master perl script calling children perl script and interacting through a pipe. I have write this code for the master : #!/usr/bin/env perl use strict; use warnings; use IPC::Open3; my @children; for my $i ( 0 .. 4 ) { …
Mayeu
  • 226
  • 3
  • 9
4
votes
1 answer

perl: IPC::Open3 fails to open STDERR with FCGI

I was testing Git::Repository with my fcgi script. I am neither able to create a git object nor run any git command using that module. IPC::Open3::open3 is failing with the error: Not a GLOB reference at /usr/local/lib/perl/5.10.1/FCGI.pm line…
Jain MJ
  • 41
  • 3
4
votes
1 answer

IPC::Open3::open3() doesn't work with perl 5.14.2 as with perl 5.10.1?

In one of our modules, we check if a given binary (varnishd) exists, and if so, we run additional tests. To perform the check, we're using IPC::Open3, like this (example stripped down for clarity): perl -MIPC::Open3 -le ' my $binary =…
Cosimo
  • 2,846
  • 1
  • 24
  • 26
3
votes
1 answer

IPC::Open3 and determining if child is waiting for input

sub run_command { my $COMMAND = shift; my @OUTPUT; my %CMD = {}; $CMD{pid} = open3(my $CH_IN, my $CH_OUT, my $CH_ERR, $COMMAND); $CMD{_STDIN} = $CH_IN; $CMD{_STDOUT} = $CH_OUT; …
Speeddymon
  • 496
  • 2
  • 20
3
votes
2 answers

perl IPC:Open3 minimal to pass perlcritic?

I am reading the perlcritic documentation to avoid backticks and use IPC::Open3 here: http://perl-critic.stacka.to/pod/Perl/Critic/Policy/InputOutput/ProhibitBacktickOperators.html I am trying to find the least verbose option that will work and…
719016
  • 9,922
  • 20
  • 85
  • 158
3
votes
3 answers

How do I influence the width of Perl IPC::Open3 output?

I have the following Perl code and would like it to display exactly as invoking /bin/ls in the terminal would display. For example on a terminal sized to 100 columns, it would print up to 100 characters worth of output before inserting a newline.…
nall
  • 15,899
  • 4
  • 61
  • 65
2
votes
1 answer

How can I use a scalar as input to open3 in perl

I have a scalar that I want to feed into open3 as the input. For example my $sql = "select * from table;"; open( SQL, "<", \$sql ); my ($output); open3( '<&SQL', $output, $output, "mysql -h 127.0.0.1" ); However, the open3 is in a different…
Lucas
  • 14,227
  • 9
  • 74
  • 124
2
votes
0 answers

win32 perl IPC::Open3() polling fhandles

I need a means to poll (ie: non-blocking-IO) on the handles created by the Win32 version of open3(), using the standard core perl items. things I know that will not work: OPEN3 - on windows, does not return normal file handles select() on…
user3696153
  • 568
  • 5
  • 15
2
votes
2 answers

perl / embperl -- IPC::Open3

I have a sample program in 2 formats perl & embperl The perl version works as a CGI but the embperl version does not work. Any suggestions or pointers to solutions would be appreciated OS: Linux version 2.6.35.6-48.fc14.i686.PAE (...) (gcc version…
Donavon Lerman
  • 343
  • 1
  • 6
  • 19
2
votes
1 answer

Why is IPC::Open3 calling cmd.exe instead of the requested program?

I'm running this on Perl 5.16.3 x64 (compiled with VC10) on Windows 7. When I run something like this: use strict; use warnings; use IPC::Open3; use Symbol 'gensym'; my $command = q[perl -e "$| = 1; for (1..60) { print '.'; sleep 1 }"]; my ($in,…
Francisco Zarabozo
  • 3,676
  • 2
  • 28
  • 54
1
vote
2 answers

perl IPC::Open3 adds additional quotes to command arguments that have quotes

I'm trying to use IPC::Open::open3() (well, really IPC::Run::run() but that calls open3())...and it has an odd behavior where if I pass a command line option with quotes, open3() will add additional quotes around that option (sometimes escaped). For…
Dave Koston
  • 254
  • 2
  • 6
1
vote
1 answer

IPC::open3 error handling with out select

The below code is working fine but i want to achieve same thing without using IO::Select - I tried few things but nothing works, as I am not much familiar with perl. sub writeTologs { my $cmd=shift; open(ERRLOG, '>>log//error.log') or die "Can't…
Azam Khan
  • 85
  • 4
  • 11
1
vote
1 answer

Perl fork process using open3

I have a perl script in which I am forking a child process. Here is what I am doing: my $pid = fork; if($pid) { # parent waitpid($pid, 0); } else { exec("some other script X.pl"); } Now, I wanted to capture the error of X.pl to display in my…
user225206
  • 63
  • 6
1
vote
1 answer

Perl select returning undef on sysread when using Windows, IPC::Open3, and IO::Socket->socketpair()

I found this example (posted by @ikegami) of a way to use IPC::Open3 on windows using sockets. The problem is that, when I run it, I get an error An existing connection was forcibly closed by the remote host on the sysread. The command runs, the…
Lucas
  • 14,227
  • 9
  • 74
  • 124
1
2