in reply to How do I get both the return value and text? backticks vs. system()

Use backticks to get output from an executed program. Check $? for the error returned.

A pipe would work in this case, but backticks are probably simpler.

Originally posted as a Categorized Answer.

  • Comment on Re: How do I get both the return value and text? backticks vs. system()

Replies are listed 'Best First'.
Re: Answer: How do I get both the return value and text? backticks vs. system()
by david2008 (Scribe) on Sep 09, 2013 at 14:42 UTC
    Update: I got confused between $? and $!. Sorry
    Hi

    I suspect that we can not rely on $? alone.
    From this perlmonks post
    $! having a non-false value is not an indication anything is wrong.

    BR,
    David