From: Sean Chittenden Date: 2001-08-02T02:33:13+09:00 Subject: [ruby-talk:18981] Re: Testing a global variable... --Yb+qhiCg54lqZFXW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > S> working? defined? didn't seem to work either... -sc > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >=20 > ??? >=20 > pigeon% ruby -e 'puts "not defined" unless defined? $testing' > not defined > pigeon%=20 >=20 > pigeon% ruby -e '$testing =3D nil; puts "not defined" unless defined? $te= sting' > pigeon%=20 Thanks Guy, I could've sworn I tried that a few different=20 times... ah well, late night. ::grin:: -sc if defined? $testing $testing +=3D 1 else $testing =3D 1 end puts $testing if defined? $testing $testing +=3D 1 else $testing =3D 1 end puts $testing --=20 Sean Chittenden --Yb+qhiCg54lqZFXW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Comment: Sean Chittenden iEYEARECAAYFAjtoPU4ACgkQn09c7x7d+q1++QCeOYHCepVaTDgbV7ZjwgcE+Aj8 9DAAoNXmmoZ/fKDtz2gPYDrVCE3g1rwI =+HIU -----END PGP SIGNATURE----- --Yb+qhiCg54lqZFXW--