专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Perl/Python

Global symbol "" requires explicit package name解决思路

发布时间:2011-06-29 20:10:53 文章来源:www.iduyao.cn 采编人员:星星草
Global symbol "****" requires explicit package name
下面是我写的perl script:
use strict;

my $irm_prop = ();
$irm_prop{"wo"} = "value";

run后出错:
Global symbol "%irm_prop" requires explicit package name at temp_2.pl line 6.
Execution of temp_2.pl aborted due to compilation errors (#1)
(F) You've said "use strict" or "use strict vars", which indicates
that all variables must either be lexically scoped (using "my" or "state"),
declared beforehand using "our", or explicitly qualified to say
which package the global variable is in (using "::").

这事我用了'use strict'后报的错,但是irm_prop是全局变量,为什么还会报错呢?


------解决方案--------------------
你声明的是$irm_prop,而你使用的是%irm_prop,两者不是同一个变量。
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: