in reply to Re^4: Dereferencing in blessed object
in thread Dereferencing in blessed object
can you immediately tell if $$x{key} means ${$x}{key} or ${$x{key}} ?
Personally I've just memorized this special case and yes, when I see $$x{key} or $$y[2] I just know this means $x->{key} or $y->[2]. I sometimes find it a bit nicer because of the parallels bewteen e.g. my %x = ( key => 42 ); print $x{key}; and my $x = { key => 42 }; print $$x{key}, but I also completely understand that people prefer $x->{key}, and I often use this style myself, for example I prefer $self->{key} over $$self{key}.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Dereferencing in blessed object
by LanX (Saint) on Feb 26, 2021 at 13:32 UTC |