I have two arrays in perl
one is @ar_1 and the other is @ar_2
____________________
| 1001 | 1002 | <--- This is @ar_1
|_________|__________|
______________________________________________________
| 1001 | a | 1003 | b | 1001 | s | 1002 | d |
-------------------------------------------------------
___________________________________
1003 | m | 1002 | r | 1001 | a | <--This is @ar_2
-----------------------------------
@ar_2 is a hash also in whihc 1001 value is "a" and "s"
1002 value is " d" and "r" etc.
This may be wrong from the concept of key -> value.
But, what I need is from those two arrays, for the elements in @ar_1
ie; for 1001 and 1002 how will you get all the values corresponding to it from @ar_2
ie for 1001, I should get " a" and "a",
for 1002 , I should get " d" and "r".
Code tags added by Arunbear
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.