Backquote & STDERR
by other posts by this author
Sep 25 2000 1:44PM messages near this date
RE: DB_File install hickup
|
New 2 Perl
Does anyone know how I can get STDERR back to a variable in my perl
program? I am running a system command in backquotes and need to interogate
STDERR to determine if it has worked or not.
I have tried the following......
@array = `$cmd 2> 1`;
where $cmd is the command I want to run. It appears to partly work. If I
omit the 2> 1 I see the STDERR on my screen and with it I do not see the
error message. In both cases however @array only contains the STDOUT data.
I could always pipe the output of the command to grep and search for the
error text but I was looking for a way to do it in Perl.
Any help would be appreciated.
Thanks.
|