in reply to html && OS variables
huck is correct about what is wrong with using system for this task. The rest of my answer is almost identical to here, including the link to this guide:
If and only if the external command you want to run is always a fixed string, then one way to do what you want would be:
use IPC::System::Simple qw/capture/; my $output = capture('ps -ef | grep syslog | grep -v grep | wc -l');
However, as I said, this is only a good idea for fixed strings, because otherwise you may introduce security issues! I wrote about the topic of running external commands at length here.
|
|---|