ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
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.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved