Why?
Concatenation (
.) forces scalar context. Arrays in scalar context return their size.
How?
You can either use
join:
$tmp = "paste -d';' " . join(' ', @{ $csvheader{x_} }) . ' > all.x.txt
+';
or just double quote the array, its members will be separated by $" which is a space by default:
$tmp = "paste -d';' @{ $csvheader{x_} } > all.x.txt";
Alternative
Instead of using
paste, use
Text::CSV_XS to process your CSV files. It handles quoted fields, escaped separators and quotes, and more.
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord
}map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,