From: Ruby Newbee Date: 2009-11-23T14:32:18+09:00 Subject: Re: How to match and count 2009/11/22 Robert Klemme : > ruby -nae 'BEGIN {$i=0}; $i+=1 if /something/ =~ $F[3]; END {puts $i}' > file.txt > ruby -nae 'BEGIN {$i=0}; /something/ =~ $F[3] and $i+=1; END {puts $i}' > file.txt > oops this is the same way as Perl's. I may adjust one point: should be: $F[3] =~ /something/; not: /something/ =~ $F[3]; After that replace "ruby" to "perl" on above commands and that will be working too. Thanks~