Make a little more ruby-ish.
Revert to while gets, for better EOF handling