or download this
use strict;
use warnings;
...
Benchmark: timing 100000 iterations of for, grep...
for: 5 wallclock secs ( 4.85 usr + 0.02 sys = 4.87 CPU) @ 20546.5
+4/s (n=100000)
grep: 6 wallclock secs ( 5.16 usr + 0.00 sys = 5.16 CPU) @ 19387.
+36/s (n=100000)