2 ms·
IO.foreach without a block returns an enumerator.
by cutler 6y ago
IO.foreach without a block returns an enumerator.
- cutler 6y agoYou may be right. This version: IO.foreach('logs1.txt') {|x| puts x if /\b\w{15}\b/.match? x } ... runs in 1.3 secs, ie. same time as Python. Still, I exepcted Ruby 3x3 to beat standard Python.