in reply to Re: Modify hash reference itself
in thread Modify hash reference itself

Yes thank you, and thanks to all, I'm shocked at the quantity, quality, and speed of the responses here.

Yea, the reason I used the {%{$a}, %{$b} } example was both because it looks simpler, and because it conveys my question (actually if I had used your example I wouldn't have had this question because you're not replacing the hash ref, you're adding/changing keys within it).

In other words, my code was just demo code, and my real sub is bigger and does more than just merge.

But while we're on the subject of hash merging, there's also this:

@b{keys %a} = values %a;
(given %a and %b)

And also I have bookmarked a thread from comp.lang.perl.misc from years ago:

http://tinyurl.com/xaiz

thanks again everyone

Replies are listed 'Best First'.
Re: Re: Re: Modify hash reference itself
by Roger (Parson) on Dec 02, 2003 at 01:07 UTC
    Ah... I discussed this approach with davido the other day, I thought the benchmarking showed that this was actually slower than my simple approach. Strangely enough. ;-)