http://www.perlmonks.org?node_id=1038264


in reply to Re: Thoughts on replacing -> with .
in thread Thoughts on replacing -> with .

I find that many people do something like:

$var->{key1}->{key2}->{key3}

when the following should suffice:

$var->{key1}{key2}{key3}

Replies are listed 'Best First'.
Re^3: Thoughts on replacing -> with .
by Ralesk (Pilgrim) on Jun 12, 2013 at 11:32 UTC

    I’m one of those people, and I’m not entirely sure why I do it. I’m fully aware that the later arrows are optional. The one arrow notation feels a bit asymmetric, and it doesn’t show that they all are refs in there, I guess.

Re^3: Thoughts on replacing -> with .
by ambrus (Abbot) on Jun 12, 2013 at 19:03 UTC

    I usually write ${${$$var{key1}}{key2}}{key3}, or, very rarely $$var{key1}{$key2}{$key3} or an intermediate variant. I never use arrow dereferencing.

      Those are particularly unusual ways of doing it. But hey, TIMTOWTDI.