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
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs