I suspect that the fastest way is to "add" %hash2 to %hash1 via: @hash1{keys %hash2}= values %hash2; but this has come up several times before and I'm pretty sure someone has run benchmarks to meet all of your premature nano-optimization needs. (:
Of course, this requires you to define your interface to allow the addition of one "set" to another without having to make a copy. I consider this a good thing. :)
- tye (but my friends call me "Tye")In reply to (tye)Re: Fast Way to Combine Two Hashes
by tye
in thread Fast Way to Combine Two Hashes
by arunhorne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |