作者sweetwords (米虫三号)
看板Perl
标题[请益] 请问为啥会跑出 array 位置呢?
时间Wed Apr 28 16:26:53 2010
以下是我写的程式,主要针对
L_bias.txt 的部份读取,然後做切割到 bias_matrix 阵列中
L_bias.txt 中的资料大概如下
1
2
3
4
5
===程式部份
open(RF,"L_bias.txt")|| die "can't open trust matrix file";
while(<RF>){
chomp;
push @bias_matrix,[ split ];
}
close RF;
for (0...$
#bias_matrix){
$bias = $bias_matrix[$_];
print $bias;
}
只不过为啥我列印出来的是
ARRAY(0x81aabf0)
ARRAY(0x81aac20)
ARRAY(0x81aac50)
ARRAY(0x81aac80)
ARRAY(0x81aacb0)
ARRAY(0x81aace0)
ARRAY(0x81aad10)
哪里有写错吗 @_@?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.117.197.56
1F:→ dm4:print @$bias; 04/28 18:47
2F:推 drm343:把 [split] 改成 split 04/28 19:02