Help for this page

Select Code to Download


  1. or download this
    { a => 'b' }->{$k};
    
  2. or download this
    my $hash_ref = { a => 'b' };
    # and then
    $hash_ref->{$k}
    
  3. or download this
    use strict;
    use warnings;
    ...
        'lexical_ref' => sub { for my $x (qw(a b a b a b)) { my $y = $lexi
    +cal_hash->{$x}; }},
        'const' => sub { for my $x (qw(a b a b a b)) { my $y = CONST_HASH(
    +)->{$x}; }},
    });
    
  4. or download this
                    Rate        hash  global_ref lexical_ref       const
    hash         27571/s          --        -73%        -74%        -76%
    global_ref  102819/s        273%          --         -3%        -10%
    lexical_ref 105720/s        283%          3%          --         -8%
    const       114361/s        315%         11%          8%          --