Re: [Andy] How to join 2 Hash's into one?In reply to
thanks andy - there's no way to assign "all" values over easily is there? maybe a for or while loop... (I can't remember how to do it it's been too long since I put my mind to programming!).
Re: [ryel01] How to join 2 Hash's into one?In reply to
$hashref3 = {%$hashref1, %$hashref2};
Keys in both hashref1 and hashref2 will end up with hashref2's value in hashref3 - reverse the order of $hashref1, $hashref2 if you want the opposite behaviour. Jason Rhinelander Gossamer Threads jason@gossamer-threads.com
Re: [Jagerman] How to join 2 Hash's into one?In reply to
In Reply To:
$hashref3 = {%$hashref1, %$hashref2};
Keys in both hashref1 and hashref2 will end up with hashref2's value in hashref3 - reverse the order of $hashref1, $hashref2 if you want the opposite behaviour.
Re: [Andy] How to join 2 Hash's into one?In reply to
Hey Andy - it's pretty good huh!
FYI - I've just been working with it and you can list as many hash's as you like to allocate to the new hash - each will override the one to the left of it.
Re: [ryel01] How to join 2 Hash's into one?In reply to
Quote:
Hey Andy - it's pretty good huh!
FYI - I've just been working with it and you can list as many hash's as you like to allocate to the new hash - each will override the one to the left of it.