Questions tagged [perl-ipc-run]

9 questions
3
votes
1 answer

How can I detect end of file on a pipe in a Perl script?

In a Perl script, I am running another process (openssl) and communicating with it via pipes. I run openssl with IPC::Run::start. $openssl_stdin_handle = Symbol::gensym(); $openssl_stdout_handle = Symbol::gensym(); $openssl_stderr_handle =…
David Levner
  • 341
  • 1
  • 8
3
votes
1 answer

perl open() always returns the PID of the sh instead of the underlying program

I have to kill a program that I am opening via $pid = open(FH, "program|") or $pid = or open(FH, "-|", "program") However, the program (mosquittto_sub, to be specific) still lingers around in the background, because open is returning the PID of the…
2
votes
1 answer

How to test the exit status from IPC::Run3

I'm trying to test the Perl module IPC::Run3 but having difficulty in checking whether a command is failed or successful. I know that IPC::Run3 issues an exit code if something is wrong with its arguments, but what about if the arguments are ok but…
PedroA
  • 1,803
  • 4
  • 27
  • 50
2
votes
2 answers

How to tell when an IPC::Run job has finished

Is there a simple, reliable way to tell when an IPC::Run task has completed, i.e. any child process(es) have exited? The docs are astonishingly silent on this. It seems that looping on pumpable works, though it's not really documented clearly as the…
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
1
vote
2 answers

Perl IPC::Run pipeline blocks with input file larger than 64KiB

A Perl program uses IPC::Run to pipe a file through a series of commands determined at runtime and into another file, like this small test excerpt demonstrates: #!/usr/bin/perl use IO::File; use IPC::Run qw(run); open (my $in, 'test.txt'); my $out…
starfry
  • 9,273
  • 7
  • 66
  • 96
1
vote
1 answer

Using the right Perl array references with IPC::Run

I'm trying to get this Perl code to work correctly and I believe I just need to get my references right. I would appreciate any feedback on how to use references, but if this code can't be made to work without API changes I would also appreciate…
ldrg
  • 4,150
  • 4
  • 43
  • 52
1
vote
1 answer

Perl send STDIN and filter STDOUT from external program

I'm writing a Perl wrapper for another application. I need to pipe STDIN and some STDOUT. Perl code #!/usr/bin/perl -w use strict; use IPC::Run3 qw(run3); my $stdout; local $| = 1; run3…
J. Doe
  • 71
  • 1
  • 6
1
vote
1 answer

Make Perl IPC::Run pump each line, not occasional batches

I use IPC::Run to get output from an external executable in a cron run script. I need it to be able to filter and make decisions based on the output on the fly. But the problem is it gives me output not on the fly, but in few batches - many lines at…
uldics
  • 117
  • 1
  • 11
1
vote
1 answer

SIGBREAK during tests while installing IPC::Run on Windows 10 x64

I can't install IPC::Run on Windows 10 x64: cpan> install IPC::Run Running install for module 'IPC::Run' Fetching with LWP: http://ppm.activestate.com/CPAN/authors/id/T/TO/TODDR/CHECKSUMS Checksum for…
c11cc
  • 35
  • 4