Quoting James Edward Gray II <james / grayproductions.net>:

> Also, I believe they are thread-local variables are they not?
> (I'm honestly asking.)  If so, I don't see a lot of concern
> about them being stomped on before they are used.

They're method-local.

def foo
  "abc" =~ /(a)/
  p $1
end

foo => "a"
p $1 => nil

-mental