Help for this page

Select Code to Download


  1. or download this
    my $ref;
    $ref = [
              {
    ...
    foreach $hashref (@{$ref}) {
        print $hashref->{'key1'};
    }#foreach
    
  2. or download this
    for (my $item = 0; $item <= $#{$ref}; $item++) {
        print $item;
        print $ref->[$item]->{'key1'};
    }#for
    
  3. or download this
    my $item = 0;
    foreach $hashref (@{$ref}) {
        print $hashref->{'key1'};
        $item++;
    }#foreach
    
  4. or download this
    my $ref;
    $ref->[0]->{'key1'} = "a";
    ...
        print $hashref->{'key1'};
        $item++;
    }#foreach