--- [EMAIL PROTECTED] wrote:
> how to copy a hash?
> example: $h is   reference  of a hash struct.
> i want to copy this hash struct.

Well, the simplistic answer would be:

  my %newHash = %{$h};

if $h = { a => 1, b => 2 }, then that's fine, but with subelements like
in a hash of hashes or arrays, you only copy the top level, which
*aliases* everything below that (*not* copying, just pointing back to
the subelements of the original).



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to