tags:

views:

60

answers:

2

I've seen magic variables like this used in Ruby. $_ $' $0

Is there a complete reference for what all of them mean and how they are set?

+1  A: 

They are called "global variables" (complete list at the bottom of the page): http://www.rubyist.net/~slagell/ruby/globalvars.html

remi
@remi, thanks for this. I have seen this link but I never really revisited it because of how incomplete of a reference it was. I'll give you +1 for linking relevant information, anyhow :)
macek
+2  A: 

Their name is global variables. There are several different references.

You can get a full list by calling the method Kernel#global_variables

puts global_variables

Ruby also includes in the standard library a file called English.rb which provides an in-depth explanation of several global variables.

Finally, here's an other reference.

Simone Carletti
This is exactly what I was looking for. Thanks :)
macek