From: Chad Perrin Date: 2011-05-04T08:48:24+09:00 Subject: Re: Iterating over an Array of Hashes --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 04, 2011 at 07:58:04AM +0900, Peter Hicks wrote: >=20 > What I want to do within the b.each loop is work on a *copy* of each > element of b, such that if I mess around with it, the changes are lost > when when the loop exits. I think this might do what you want: Marshal.load(Marshal.dump b).each |b_item| # do stuff end It's ugly and kludgey, but it should work. --=20 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --Qxx1br4bt0+wmkIi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk3AkIMACgkQ9mn/Pj01uKVKIQCfamKmAoptg8QIedOZqxCYpPoV 4pEAnRhW4QbXbmQOmY8/oYHrNz253LZk =TetJ -----END PGP SIGNATURE----- --Qxx1br4bt0+wmkIi--