in reply to help needed with map
Thanks to Anonymonk for pointing out that I had tested insufficiently. And now I've got the quoting. But I'm not using reduce anymore.my @foo = ([qw(one two)], [qw(three four)], [qw(five six)]); # use List::Util 'reduce'; # oops: my $str = reduce {"[$a,$b]"} map { reduce {"[$a,$b]"} @$_ } @f +oo; my $str = sprintf "[%s]", join ',', map { sprintf '["%s"]', join '","' +, @$_} @foo; print "--- $str ---\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: help needed with map
by Anonymous Monk on Sep 30, 2005 at 00:05 UTC |