Help for this page

Select Code to Download


  1. or download this
    my %hash = (a=>1, b=>2);
    my $hashRef = { c=>3, d=>4 };
    ...
    # use an arrow:
    $v = $hashRef->{c};
    $v = $$hashRef{c};
    
  2. or download this
    # Get a reference to %hash
    $hashRef = \%hash;
    
    $v = $hashRef->{a};  # $v now holds 1