Are quotes around hash keys a good practice in Perl?

后端 未结 13 2063
伪装坚强ぢ
伪装坚强ぢ 2020-12-03 06:24

Is it a good idea to quote keys when using a hash in Perl?

I am working on an extremely large legacy Perl code base and trying to adopt a lot of the best practices s

13条回答
  •  死守一世寂寞
    2020-12-03 07:05

    You can precede the key with a "-" (minus character) too, but be aware that this appends the "-" to the beginning of your key. From some of my code:

    $args{-title} ||= "Intrig";
    

    I use the single quote, double quote, and quoteless way too. All in the same program :-)

提交回复
热议问题