in reply to Re: help needed with map
in thread help needed with map
#!/usr/bin/perl -w use strict; my @foo = ([qw(one two)], [qw(three four)], [qw(five six)]); use List::Util 'reduce'; my $str = reduce {"[$a,$b]"} map { reduce {"[$a,$b]"} @$_ } @foo; print "--- $str ---\n"; my $seen = 0; $str = reduce { $seen++ ? $a.",[$$b[0],$$b[1]]" : "[$$a[0],$$a[1]],[$$b[0],$$b[1]]" } @foo; print "--- [$str] ---\n";
|
|---|