Dear Monks,
I had asked this question in CB yesterday but unforntunately was not able to solve the problem with the lead given. And after seeing the node for XY Problem I have repharsed my question! :) Please help me out in finding the right solution to the below problem
I have two hashes which would look as shown below
%hashA = ( 11.5 => 1723478, 1734789, 1798761
11. 12 => 1700123,
11.01 => 1780345
);
I hope that the above multi-valued key can be established with Data::Dumper and Push.
%hashB = ( 1723478 => 237,
1734789 => 114,
1798761 => 147
);
My situtaion is,
1. I have to find the max key in
hashA which hopefully can be done with
max keys (%hashA).
2. One specific value has to be removed from a key. For example value 1734789 has to be removed from the key 11.5 leaving the other values intact.
3. Remove the corresponding key/pair value from hashB.
My problem is with step 2: I was not able to find a simple and quick approach to remove specific values of a particular key.
Please advise me on this.
Thanks,
Eshwar.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.