Help for this page

Select Code to Download


  1. or download this
    my $ref = pointer_to_element(\%myhash, qw(bedrock flintstone fred));
    $$ref = 42; # set it to 42
    $$ref++; # increment it
    print $$ref; # print it!
    
  2. or download this
    sub pointer_to_element {
      require List::Util;
      return List::Util::reduce(sub { \($$a->{$b}) }, \shift, @_);
    }