develooper Front page | perl.beginners | Postings from August 2009

Convert Array's into hashes

Thread Next
jet speed
August 6, 2009 03:20
Convert Array's into hashes
Message ID:

I have a query on converting arrays into hash.Please could you help me
resolve the below.

I have 2 arrays as bleow.

@array1 = ( D_101 D_102 D_103 D_104);
@array2 = (0 1 2 3);

How can i convert both of these arrays into %hash, assigining the
@array1  as keys and @array2 as values.
How can I recall only certain keys and their corresponding values of hashes
ex : if D_103 then print " D_103 value is 2"
ex :if D_101 then print "D_101 value is  0"

any help on this would be much appreciated.

Many Thanks

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About