in reply to Caturing 7zip output with Perl
Unfortunately too much of your example is either commented out or are variables which we cannot tell how you have set. An SSCCE would be preferable. Here's one showing how it works:
#!/usr/bin/env perl use strict; use warnings; my $command = 'echo foo'; my $stdout = `$command`; print "STDOUT: $stdout"; $command = 'ls some-missing-file'; my $stderr = `$command 2>&1 >/dev/null`; print "STDERR: $stderr"; print "\nNow display stdout while command runs:\n"; $command = 'echo bar;sleep 3; echo baz'; open my $pipe, "($command) |"; while (<$pipe>) { print; } close $pipe
Caveat: only tested on Linux. Differences on Win32 are O/S related and not something I can help you with.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Capturing 7zip output with Perl
by Anonymous Monk on Feb 23, 2016 at 09:57 UTC |