List of hash : Hash Collections « Hash « Perl






List of hash

    
#!/usr/bin/perl
use warnings;
use strict;

my (@list_of_hashes, %hash_of_lists, %mixed_bag, $my_object);
my @my_list = (1,2,3,4,5);

@list_of_hashes = (
   { Monday=>1, Tuesday=>2, Wednesday=>3, Thursday=>4, Friday=>5 },
   { Red=>0xff0000, Green=>0x00ff00, Blue=>0x0000ff },
);
print "$list_of_hashes[0]{Tuesday}.", "\n";

   
    
    
    
  








Related examples in the same category

1.Hash of list
2.Hash of Hashes
3.Hash of Hashes with Lists of Values
4.Use hash as an array
5.Nested hashes