- 论坛徽章:
- 0
|
昨天根据大家的意见又试了半天,现在问题集中到%hash上了,又一段代码的结果很奇怪:
for (keys %hash){
if ($count++ < 10){
my $trash = chomp($hash{$_});
print "$trash aaa\n";
my @try = split(//, $hash{$_});
# print $#try, "\t@try\t";
print "\$try[0] = $try[0]\n";
my $str = "";
foreach $i (0 .. $#try){
print "$try[$i] ";
my @inter = split(//, $try[$i]);
print "$#inter\t";
$str .= "$inter[0]";
}
print "\n$str\n";
# print "$hash{$_}\n";
}
} |
输出结果为(截取一个):
0 aaa
$try[0] = 6 ###为@try的第一项
00 3 0 9 0 6 0 9 0 ###无法显示$try[0]!!!
63969 ###为$hash{$_}值
奇怪啊,有没有人遇到过类似的问题啊? |
|