On Fri, 2 Sep 2005, Berger, Daniel wrote:

> That can be shortened to:
>
> IO.foreach("testdict.txt"){ |line|
>    line.downcase!.chomp!
>    puts line if line == line.reverse?
> }
>
> Note the chomp!

Never chain bang methods:

irb(main):001:0> "hello".downcase!.chomp!
NoMethodError: private method `chomp!' called for nil:NilClass
         from (irb):1

Peter