in reply to Getting rid of $/ on linux

Here's a variant on jwkrahn's approach that's closer to what seems to be the real goal of the OP code:
my $ps_output = $ssh->exec( 'ps efax 2>/dev/null' ); my @stat = ( $ps_output =~ /firstbo.*/g ); my $stat = scalar @stat;
Counting matches locally is just easier. Note that the regex match here uses "firstbo.*" to make sure it matches "firstbo" only once per line (just like the remote "grep" command would have done).