Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Remove duplicate key value pair in hash

by Anonymous Monk
on Sep 19, 2014 at 19:33 UTC ( [id://1101282]=note: print w/replies, xml ) Need Help??


in reply to Re: Remove duplicate key value pair in hash
in thread Remove duplicate key value pair in hash

No, since you still haven't specified whether you mean that you want pairs such as (foo=>'bar',bar=>'foo') removed, or whether you consider "one" and "1" to be equal.

Replies are listed 'Best First'.
Re^3: Remove duplicate key value pair in hash
by reaper9187 (Scribe) on Sep 19, 2014 at 19:35 UTC
    I have modified the example now to remove the confusion. I hope it is clear now.

      If anything, it’s less clear to me… :P Examine this for a moment before you update or try to clarify–

      perl -MData::Dump=pp -e "pp {aaa=>'bbb', bbb=>'aaa', ccc=>'bbb', bbb=> +'ccc', abc=>'123'}" { aaa => "bbb", abc => 123, bbb => "ccc", ccc => "bbb" }

      Maybe hashes don’t work the way you think? You see the extra bbb key is already “deduplicated.”

      Update: and you silently updated the code in the OP… again. :(

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1101282]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 18:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found