taj has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: How to accees this in perl?
by plobsing (Friar) on Jan 27, 2008 at 23:27 UTC
    Try formatting your questions please.

    If I understand your question correctly:

    First, you need to convert @ar_2 into a hash.
    my %hash = @ar_2;
    Then you need to access the hash for the elements of @ar_1
    @hash{@ar_1};
      It is pretty hard from the OP to identify exactly what taj is looking for --- but simply turning @ar_2 into a hash: my %hash = @ar_2 won't work in this case.

      It appears that the values of the keys (at least some of them) are actually going to be a list:

      @ar_2 is a hash also in whihc 1001 value is "a" and "s" 1002 value is " d" and "r" etc.

      Simply copying to a hash would yield only one (the last) result per key.

      So, a map or loop of some sort would be needed to assign the list of values to each key. I leave that as an exercise for the OP, who didn't provide us with an inkling of what effort was already put forth.

Re: How to accees this in perl?
by hipowls (Curate) on Jan 27, 2008 at 23:47 UTC

    taj, this is the second question in as many days where you have presented badly formatted code. I suggested then that you should use <p>, </p>, <code>, and </code> tags and read Writeup Formatting Tips. Granted you did go back and tidy it up but why not do it in the first place? The preview page shows you what it will look like and gives you the chance to fix it then.

    If you don't take our advice about presenting your question we may suspect that our words are falling on deaf ears. Please show us the courtesy that we showed you

    A reply falls below the community's threshold of quality. You may see it by logging in.