in reply to Capturing STDERR from a piped open
FWIW, it works fine for my (on Linux):
use strict; use warnings; my $cmd = 'ls nonexistent'; open( CMD, "$cmd 2>&1 |" ) or die "Could not execute $cmd: $!\n"; while ( <CMD> ) { chomp; print "<< $_ >>\n"; } __END__ % perl 483558.pl << ls: nonexistent: No such file or directory >>
the lowliest monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Capturing STDERR from a piped open
by McDarren (Abbot) on Aug 13, 2005 at 15:45 UTC | |
by tlm (Prior) on Aug 13, 2005 at 15:55 UTC |