Help for this page

Select Code to Download


  1. or download this
    my $a = []; $a->[1]{bar}{baz}[3] = 7;
    bless $a, "hrmph";
    *hrmph::deref = sub { $_[0]->[1]{bar}{baz}[3] };
    print "yeah: ", $a->deref, "\n";
    
  2. or download this
    my $x = []; $x->[1]{bar}{baz}[3] = 7;
    bless $x, "whatever";
    my $deref = sub { $_[0]->[1]{bar}{baz}[3] };
    print "yeah: ", $x->$deref, "\n";
    
  3. or download this
    my $x = []; $x->[1]{bar}{baz}[3] = 7;
    # bless $x, "whatever";
    my $deref = sub { $_[0]->[1]{bar}{baz}[3] };
    print "yeah: ", $x->$deref, "\n";