in reply to how to get out data of a hash?
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,
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to get out data of a hash?
by blaui (Initiate) on Apr 18, 2018 at 07:05 UTC | |
Re^2: how to get out data of a hash?
by Anonymous Monk on Apr 17, 2018 at 13:02 UTC | |
by marto (Cardinal) on Apr 17, 2018 at 13:10 UTC | |
by Your Mother (Archbishop) on Apr 17, 2018 at 17:46 UTC | |
|
In Section
Seekers of Perl Wisdom