@arr = (1,2,3); $scal = "@arr" # $scal is now 123.
使用引号是平铺数组的唯一方式,以便将每个元素存储在标量值中?这似乎不太可能,但是我还没有找到任何其他方法来做到这一点.提前致谢.
join
$scal = join(",",@arr); # $scal is no "1,3"