【发布时间】:2012-07-27 04:19:49
【问题描述】:
我正在尝试在嵌套的 for/foreach 循环中使用哈希。 see Source
strict 表示
Global symbol "$mapping" requires explicit package name at ./test2.pl line 39.
Execution of ./test2.pl aborted due to compilation errors.
没有strict,
Use of uninitialized value $mapping in hash element at ./test2.pl line 46, <$fh> line 8.
Use of uninitialized value in concatenation (.) or string at ./test2.pl line 46, <$fh> line 8.
print $hashref->{$mapping} 在输出中为空。
什么是错误?
【问题讨论】:
-
Use of uninitialized value $mapping不够清楚? -
我认为一些有经验的版主可以编辑这个问题的标题以更好地适应问题。
-
@Victor 你可以随时编辑问题/标题,有人会过来为你批准/不批准。
-
不错。我不知道(实际上“留给海狸”是我所相信的)。