in reply to Hash Splice

The notion of "splicing" only applies to arrays, where elements are ordered in a numeric sequence; deleting a non-final element from an array requires that all higher-numbered elements be shifted, in order to keep the overall sequence contiguous, and that is what splice does.

Since hashes are unordered, the notion of splicing does not a apply. An element (hash key) either exists or does not exist. If one exists and you want it to cease existing, you simply delete it.

Replies are listed 'Best First'.
Re^2: Hash Splice
by osirisgothra (Initiate) on Dec 06, 2014 at 18:34 UTC
    your right, and you can demonstrate this problem in part by converting the two hashes to lists, splicing them, and then converting them back, if you have any elements that have duplicate names will disappear and the one that came last will get the value and that's already error prone, and then you have the even-list checking and making sure the keys don't become values and vice-verse' by accident -- it can be VERY error prone... its better to just delete and set keys as needed then to do it this way, or merge to hashes, but arrays are like Christmas and hashes are like Easter, if you get what I mean.