Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
cutler
5y ago
0 comments
Save
Share
IO.foreach without a block returns an enumerator.
0 comments
1 comments · 1 top-level
top
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