求助:Reference found where even-sized list expected 的解决

求助:Reference found where even-sized list expected 的解决

如题,定义%Hash={};
结果:Reference found where even-sized list expected 。。。请问怎么回师?


QUOTE:
原帖由 jack-ni 于 2008-6-4 15:01 发表
如题,定义%Hash={};
结果:Reference found where even-sized list expected 。。。请问怎么回师?

{} 是返回一个 hash 引用

你要定义空 hash 应该

%hash = ();
谢谢!
你好好去看看引用是怎么一回事

[Copy to clipboard] [ - ]
CODE:
my %hash = ();
my @array = ();
my $hash_ref = {};
my $array_ref = [];