Quoting issues in the backticks aside, it might be worth the 4 extra lines of code to simply open a pipe from ps and do the winnowing and line counting yourself in your Perl rather than piping to the external commands.
open( my $ps_fh, "-|", "ps -ef" ) or die "Can't open pipe from ps: $!\ +n"; my $load = 0; while( <$ps_fh> ) { $load++ if /somecmnd\.exe$/; } close( $ps_fh );
We're looking for a Perl and Database Developer for Corporate Investments Group.
In reply to Re: Quoting in Backtick
by Fletch
in thread Quoting in Backtick
by neversaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |