读完07 $和
this question我的$var和my($var)之间的差异后,我仍然无法看到为什么Data :: Dumper模块在下面的代码摘录中使用了parens.这些问题的答案中描述的差异似乎都不适用于此.
@H_502_8@
@H_502_8@
my($s) = { level => 0,# current recursive depth indent => $Indent,# varIoUs styles of indenting # a bunch of other settings removed for brevity's sake deparse => $Deparse,# use B::Deparse for coderefs noseen => $Sparseseen,# do not populate the seen hash unless necessary };
我在一个小脚本中对它进行了测试,并且我觉得将此声明为我的($s)或我的$s之间没有任何区别.在这两种情况下,它都是哈希的标量引用,据我所知.@H_502_8@
我错过了什么吗?@H_502_8@
解决方法
我($s)没有理由在这里使用而不是我的$s.我甚至无法理解一个风格上的理由.这确实很奇怪.