I want to get both stdout and stderr into $var, and get correct $? I went through solutions in perlfac8 and forums The strange thing that I DON'T get sdterr in any case, as long as correct result code. perl version is 5.8.8, Linux RH 5
my $cmd="lsss"; my $out=`$cmd 2>&1`; or my $out=qx($cmd 2>&1); or open(PIPE, "$cmd 2>&1|");
stdout when command is correct I get ok. I don't want to use additional *capture* modules.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |