in reply to Quoting in Backtick

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 );