http://qs321.pair.com?node_id=775924


in reply to How to make a hash out of two arrays,one with keys and other with values?

mapping is the best..... since you have large arrays
use strict; my %hash=map {@array1[$_]=>@array2[$_]} 0..$#array1;

Replies are listed 'Best First'.
Re^2: How to make a hash out of two arrays,one with keys and other with values?
by NetWallah (Canon) on Jun 30, 2009 at 13:27 UTC
    No - that does not work.

    You need =>     , not =

    . Also, the preferred sigil for array element in perl5 is $.

    my %hash=map {$array1[$_]=>$array2[$_]} 0..$#array1;
    (Identical to ikegami's posting.)

         Potentia vobiscum ! (Si hoc legere scis nimium eruditionis habes)

      really sorry.........
      i overlooked it.....