in reply to Make CSV list from values in AoH
$csv = join "," , map { "'$_'" } map { $AoH[$_]{name} } 0 .. $#AoH;
maybe clearer are two lines
push @names, $_->{name} for @AoH; $csv = join "," , map { "'$_'" } @names;
$csv = join "," , map { "'$_'" } map { $_->{name} } @AoH;
of course you are free to merge the two maps into one :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Make CSV list from values in AoH
by tel2 (Pilgrim) on Aug 17, 2018 at 23:13 UTC | |
by LanX (Saint) on Aug 17, 2018 at 23:27 UTC | |
by tel2 (Pilgrim) on Aug 17, 2018 at 23:40 UTC |