in reply to Getting rid of $/ on linux
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).my $ps_output = $ssh->exec( 'ps efax 2>/dev/null' ); my @stat = ( $ps_output =~ /firstbo.*/g ); my $stat = scalar @stat;
|
|---|