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:
--
bm
see perldoc -q capturemy $cmd = '/this/is/a/command -sdfw'; my $result = `$cmd 2>&1`; do_something() if ($result =~ /regex/);
--
bm
|
---|
In Section
Seekers of Perl Wisdom