Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners Cgi > Re: packing an ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 1411 of 1490
Post > Topic >>

Re: packing an array of hashes

by shawnhcorey@[EMAIL PROTECTED] (Mr. Shawn H. Corey) Aug 7, 2007 at 08:01 PM

Chris Cosner wrote:
> If you put a hash reference into an array
>     push @[EMAIL PROTECTED]
 \%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 @[EMAIL PROTECTED]
 { %hash };

This creates an anonymous hash and populates it with the contents of
%hash.  It makes a copy of %hash.  Of course, if %hash has any references,
they will be copied but not their contents.


-- 
Just my 0.00000002 million dollars worth,
  Shawn

"For the things we have to learn before we can do them, we learn by doing
them."
  Aristotle
 




 5 Posts in Topic:
packing an array of hashes
ccosner@[EMAIL PROTECTED]  2007-08-07 16:47:06 
Re: packing an array of hashes
shawnhcorey@[EMAIL PROTEC  2007-08-07 20:01:12 
Re: packing an array of hashes
ccosner@[EMAIL PROTECTED]  2007-08-07 17:27:11 
Re: packing an array of hashes
rcook@[EMAIL PROTECTED]   2007-08-08 10:01:27 
Re: packing an array of hashes
mritty@[EMAIL PROTECTED]   2007-08-08 10:26:45 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 1:56:27 CDT 2008.