How can I run an external command and capture its output in Perl?
You can use the backtics to execute your external program and capture its stdout and stderr. By default the backticks discard the stderr and return only the stdout of the external program.So $output = `cmd`; Will capture the stdout of the program cmd and discard stderr. To capture only stderr you can use the shell’s … Read more