http://www.perlmonks.org?node_id=289139


in reply to executing commands and getting output

Use backticks. This only captures STDOUT, so you should add shell redirection to capture any errors that appear on STDERR:
my $cmd = '/this/is/a/command -sdfw'; my $result = `$cmd 2>&1`; do_something() if ($result =~ /regex/);
see  perldoc -q capture
--
bm