Posted By

yoblob on 02/17/11


Tagged

perl hashmap


Versions (?)

perl hashmap


 / Published in: Perl
 

create hashmap iterate through and print values

  1. %testHashpMap = ();
  2.  
  3. $testHashpMap {"delhi"} = "india";
  4. $testHashpMap {"london"} = "uk";
  5. $testHashpMap {"new york"} = "us";
  6. $testHashpMap {"tokyo"} = "japan";
  7.  
  8. foreach $city ( keys %testHashpMap )
  9. {
  10. print $city;
  11. print "\n";
  12. }

Report this snippet  

You need to login to post a comment.