Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by chromatic (Archbishop)
on Jun 21, 2000 at 08:02 UTC ( [id://19164]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://19164]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-07-15 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.