Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by lhoward (Vicar)
on Jun 21, 2000 at 02:00 UTC ( [id://19120]=note: print w/replies, xml ) Need Help??


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

open has a piping syntax that you can use to pipe data to or from a program. You can get the exit value from $? (see perlvar).
open P,"command |" or die "error running command $!"; my @data=<p>; close P; my $exit_value=$? >> 8;
  • Comment on Re: How do I get both the return value and text? backticks vs. system()
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://19120]
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-04-24 08:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found