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
In reply to Re: Capturing STDERR from a piped open
by tlm
in thread Capturing STDERR from a piped open
by McDarren
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |