Help for this page

Select Code to Download


  1. or download this
       foreach my $d (@{$array_of_hashes}) {
        print $d[0]{'one1'};    
       }
    
  2. or download this
       foreach my $h (@{$array_of_hashes}) {
        print $h->{'one1'};    
       }
    
  3. or download this
        print $array_of_hashes[0]{'one1'};    
        print $array_of_hashes[0]{'one2'};    
        print $array_of_hashes[1]{'two1'};    
        print $array_of_hashes[1]{'two2'};
    
  4. or download this
        print $array_of_hashes->[0]{'one1'};    
        print $array_of_hashes->[0]{'one2'};    
        print $array_of_hashes->[1]{'two1'};    
        print $array_of_hashes->[1]{'two2'};
    
  5. or download this
    my %hash;
    my @array;
    ...
    push @array, \%hash;
    ...
    push @array, \%hash;
    
  6. or download this
    my @array;
    {
    ...
       ...
       push @array, \%hash;
    }