$line = ['solid' , 'black' , ['1','2','3','10','101'] , ['4','5','6']];
$len = scalar(@$line);
for($i = 0; $i < $len; $i += 1){
$seclen=$line->[$i];
$lenj=scalar(@$seclen);
if ($seclen=~/^ARRAY/(.*/)$/){
for($j = 0; $j <$lenj; $j += 1){
print "line[$i][$j]=$line->[$i]->[$j]/n";
}
}else{
print "line[$i]=$line->[$i]/n";
}
}
perl二维数组的遍历
最新推荐文章于 2021-09-08 14:57:54 发布