Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
0 points
cutler
5y ago
0 comments
Share
IO.foreach without a block returns an enumerator.
undefined | Better HN
0 comments
default
newest
oldest
cutler
OP
5y ago
You 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.
j
/
k
navigate · click thread line to collapse