Tips for golfing in Ruby What general tips can you give for golfing in Ruby?

I'm looking for ideas that can be applied to code golf problems in general that are specific to Ruby. (For example, "Remove comments" would not be an answer.)

Please post one tip per answer.
The numbers 100 to 126 can be written as ?d to ?~ in 1.8.
On a similar note if you need a single-character string in 1.9 ?x is shorter than "x".
If you need to print a string without appending a newline, $&gt;&lt;&lt;"string" is shorter than print"string".
If you need to read multiple lines of input $&lt;.map{|l|...} is shorter than while l=gets;...;end. Also you can use $&lt;.read to read it all at once.
If you're supposed to read from a file, $&lt; and gets will read from a file instead of stdin if the filename is in ARGV. So the golfiest way to reimplement cat would be: $&gt;&lt;&lt;$&lt;.read.