Nested dereferencing arrows in Perl: to omit or not to omit?

后端 未结 3 2058
一向
一向 2020-12-20 17:34

In Perl, when you have a nested data structure, it is permissible to omit de-referencing arrows to 2d and more level of nesting. In other words, the following two syntaxes a

3条回答
  •  星月不相逢
    2020-12-20 18:08

    I have always written all of the arrows. I agree with you, they separate better the different subscripts. Plus I use curly braces for regular expressions, so to me {foo}{bar} is a substitution: s{foo}{bar} stands out more from $s->{foo}->{bar} than from $s->{foo}{bar}.

    I don't think it's a big thing though, reading code that omits the extra arrows is not a problem (as opposed to any indentation that's not the one I use ;--)

提交回复
热议问题