When you are using string interpolation, (as you should pr Martin Büttner's postMartin Büttner's post), you don't need the curly brackets if your object has a sigil ($
, @
) in front of it. Useful for magical variables like $_
, $&
, $1
etc:
puts "this program has read #$. lines of input"
So also if you need to print a variable more than you use it otherwise, you may save some bytes.
a=42; puts "here is a: #{a}"; puts "here is a again: #{a}"
$b=43; puts "here is b: #$b"; puts "here is b again: #$b"