From: "Bartosz DziewoƄski" Date: 2013-05-29T07:48:31+09:00 Subject: Re: AAARRRRGH! s="#$" => SyntaxError: compile error Ah, I've found it now: the hash is treated as beginning string interpolation, the $ as the beginning of a global variable name, the quote as the rest of variable name, and then you have no closing quote. Compare this with: irb(main):001:0> $a = 5 => 5 irb(main):003:0> "#{$a}" => "5" irb(main):002:0> "#$a" => "5" irb(main):004:0> "#{$"}" => (lots of stuff) ("#$"" is valid, too, but doesn't work in IRB.) Also see http://bugs.ruby-lang.org/issues/5156 , reporting this issue, closed as "Rejected". -- Matma Rex