in reply to Interpolation in character class
So the answer to your question is that your construction works because you would expect a double-quoted string to work that way. You could also use the octal excape syntax: /\A\020[^\020]/.
The reason \x{$a} doesn't work is the same reason that it doesn't work in a double-quoted string - probably that the double-quoted string interpolation mechanism is single-pass and not recursive. (This is only a guess.)
|
|---|