--------------enig211ED926D3528FDDFC47BC1B
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Vitaly said:
I'd like to access a global variable from within a function, without
passing it as paramater. How do I do it? e.g
You want to use a global variable, like so:
def func
puts $i
end
$i = 5
func
The "$" tells Ruby it's global.
In PHP, for example, I could use the "global" keyword in the function.
Yeah... one of the most distracting "features" of PHP *shrugs*.
Sebastian
--
It was mentioned on CNN that the new prime number discovered recently is
four times bigger than the previous record.
~ John Blasik
--------------enig211ED926D3528FDDFC47BC1B
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFD2+iK8X9UC2T3lakRApbyAJ9FzNIQ4g0wHiGeHwG7DnLCtGL9yQCfUsGq
zTgoouW0ar8zHOt13LxUspU=
=Vl1C
-----END PGP SIGNATURE-----
--------------enig211ED926D3528FDDFC47BC1B--