method

each

each(eol=$/)
public

Executes the block for every line in the stream where lines are separated by eol.

See also #gets