2009年2月4日星期三

[PerlChina] 关于tie的一个疑问

代码如下, 很简单的一段。但是我发现加上中间那个tie语句后,ref得到的就是空值,而不加的话就是ARRAY,用的是Fdedora 8上的5.8.8的perl。
tie好像不应该会改变变量的属性的吧。不知道如何解释,请大家帮忙:

use Fcntl;
use SDBM_File;
our %hash;
#tie( %hash, 'SDBM_File', 'test.dbm', O_RDWR | O_CREAT, 0640 )
# || die $!;
$hash{'networks'} = [ 'PRO2040X0', 'PRO2040X1', 'xxx' , 'yyy' ];
my $type = ref( $hash{'networks'} );
print "type: $type\n";

--
You should be the change you wish to see in the world

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

没有评论: