in reply to Capture return value from a cmd when it errors

Have a look at ${^CHILD_ERROR_NATIVE} in this Q&A node. How do I get both the return value and text? backticks vs. system().

Update: You'll notice the status value from backticks is returned to $? but perl adds a byte on the end so you need to shift it 8 bits to the right to get the code. That being said I've had problems with third party executables that had large return values. $? wasn't large enough to hold both the Perl added byte and the original 32 bit return code.

Replies are listed 'Best First'.
Re^2: Capture return value from a cmd when it errors
by sravs448 (Acolyte) on Aug 05, 2014 at 13:43 UTC
    I am looking for return message not the code .sory if i am not clear in my question