From: Paul Danese Date: 2007-06-16T05:51:26+09:00 Subject: Re: test to see if a variable exists -----Original Message----- From: Colin Summers [mailto:bladenut@gmail.com] Sent: Friday, June 15, 2007 4:36 PM To: ruby-talk ML Subject: test to see if a variable exists So I am stealing all these identities and storing everything in a big array of objects stolen_identity, and having the index be social security numbers: ss[34323843] = Stolen_identity.new But say I pick up a paycheck stub and it has 3428294. How do I know if I already have it? Does if (exist ss[3428294]) then ... end work? How can I see if a variable exists? Thanks. (please include your social security with your answer) ss[34323843].nil? my ss# is 1123581321