in reply to Re^3: running command line from Perl
in thread running command line from Perl

system does not capture output, "print" in parent just says "0"

Replies are listed 'Best First'.
Re^5: running command line from Perl
by NetWallah (Canon) on May 18, 2022 at 15:14 UTC
    Documentation for system explicitly says:

    This is not what you want to use to capture the output from a command; for that you should use merely backticks or qx//, as described in "`STRING`" in perlop. Return value of -1 indicates a failure to start the program or an error of the wait(2) system call (inspect $! for the reason).

                    "These opinions are my own, though for a small fee they be yours too."

      It's worth noting that AnoMonk was right, the output of the command bypassed Perl (instead of being printed by Perl) and went via STDOUT directly to the console.

      I've updated the misleading node.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery