From: Chad Perrin Date: 2011-10-22T11:46:09+09:00 Subject: Re: global variable -- last expression --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 22, 2011 at 10:48:00AM +0900, Eric Hodel wrote: > On Oct 21, 2011, at 5:34 PM, basha c. wrote: > > In IRB the last expression is in _ . But if you are in a ruby program > > how to get the last expression. >=20 > You assign it to a variable: >=20 > value =3D 1 + 1 >=20 > puts "the value was #{value}" Mightn't that lead to some "shallow copy" problems in some cases? --=20 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --TB36FDmn/VVEgNH/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk6iLg8ACgkQ9mn/Pj01uKUB4ACdEgbNcTirqwZ8e4YLVF0tP5hU 3n0AoPmntbSQ+EyaVWna5/oagEw+8cOH =pldC -----END PGP SIGNATURE----- --TB36FDmn/VVEgNH/--