packing an array of hashes

2007-08-07 Thread Chris Cosner
I've re-read perlref and have been trying to tease an answer out of the Perl Cookbook. If you put a hash reference into an array push @array, \%hash; you do not store any actual hash data in the array. So if you change the hash, then later pull the hash reference from the array and access

Re: packing an array of hashes

2007-08-07 Thread Mr. Shawn H. Corey
Chris Cosner wrote: If you put a hash reference into an array push @array, \%hash; you do not store any actual hash data in the array. So if you change the hash, then later pull the hash reference from the array and access it, you get changed data. push @array, { %hash }; This creates an

Re: packing an array of hashes

2007-08-07 Thread rcook
I've re-read perlref and have been trying to tease an answer out of the Perl Cookbook. If you put a hash reference into an array push @array, \%hash; you do not store any actual hash data in the array. So if you change the hash, then later pull the hash reference from the array and

Re: packing an array of hashes

2007-08-07 Thread Chris Cosner
Aha. Many thanks. Now I'm on the right track (see Anonymous Data in the Perl Cookbook, ch. 11). Mr. Shawn H. Corey wrote: Chris Cosner wrote: If you put a hash reference into an array push @array, \%hash; you do not store any actual hash data in the array. So if you change the hash, then