Help for this page

Select Code to Download


  1. or download this
    my $hash = { a => 'b' };
    $hash->{$x}
    
  2. or download this
    {a => 'b'}->{$x}
    
  3. or download this
    our $hash = { 'a' => 'A', 'b' => 'B'};
    
    ...
        'hash' => sub { for my $x (qw(a b a b a b)) { my $y = { 'a' => 'A'
    +, 'b' => 'B'}->{$x}; }},
        'ref' => sub { for my $x (qw(a b a b a b)) { my $y = $hash->{$x}; 
    +}},
    });