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