IO.foreach(name, sep=$/ [, open_args]) {|line| block } â nilIO.foreach(name, limit [, open_args]) {|line| block } â nilIO.foreach(name, sep, limit [, open_args]) {|line| block } â nilIO.foreach(...) â an_enumerator
Class Public methods
Executes the block for every line in the named I/O port, where lines are
separated by sep.
If no block is given, an enumerator is returned instead.
IO.foreach("testfile") {|x| print "GOT ", x }
pr