That last bit was confusing; String.lines returns an iterator unless I pass in a block, in which case it executes the side effects for that line and then returns the original string.  I'm not really sure how to use it in the way you suggest.