or download this
$ perl -MBenchmark=timethese -e <<'EOC'
$a = [ 0 ..5_000 ];
...
Benchmark: timing 2000 iterations of index, iterator...
index: 27 wallclock secs (21.21 usr + 0.02 sys = 21.23 CPU) @ 94
+.21/s (n=2000)
iterator: 6 wallclock secs ( 5.39 usr + 0.00 sys = 5.39 CPU) @ 37
+1.06/s (n=2000)