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
system/backticks output not as expected
by Lars Oeschey other posts by this author
Oct 30 2009 6:38AM messages near this date
RE: Accessing Extended File Attributes - Word Document | RE: system/backticks output not as expected
Hi,

I have a problem getting the output of a system call. It's a simple
code:

my $return=`$command`;
print "$?\n";
print "result:$return\n";

(I am calling a command which actually doesn't exist, to check error
handling)

as result on the console I have:

Das System kann das angegebene Laufwerk nicht finden.
256
result:

The first error says it can't find the program. Actually I expected this
in $return.

compared to system():

my $return=system("$command");
print "$?\n";
print "result:$return\n";

Das System kann das angegebene Laufwerk nicht finden.
256
result:256

So obviously system() returns the error code. But why don't the
backticks return anything at all? Ideally I'd want all the output
catched to log, but still be able to react on errors...

Lars

_______________________________________________
ActivePerl mailing list
ActivePerl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Lars Oeschey
Brian Raven
Serguei Trouchelle
Conor Lillis

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