Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by jffry (Hermit)
on Feb 14, 2006 at 23:34 UTC ( [id://530256]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open(CMD, '-|', '/usr/bin/ls', '$4', '$PATH');
    my $output = do { local $/; <CMD> };
    close CMD;
    print "$output\n";
    
  2. or download this
    ls: 0653-341 The file $4 does not exist.
    ls: 0653-341 The file $PATH does not exist.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-07-22 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.