eyepopslikeamosquito has asked for the wisdom of the Perl Monks concerning the following question:
Given two "parallel" arrays, @d and @z, known to be of equal size, want to append each element of @d onto each element of @z:
$z[$_] .= $d[$_] for 0..$#z; # one way @z = map($z[$_].$d[$_], 0..$#z); # another way
Better ways to do it? Will Perl 6 do this more elegantly?
Title edit by tye
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Appending one array onto another
by sauoq (Abbot) on Jun 10, 2003 at 09:00 UTC | |
by Aristotle (Chancellor) on Jun 10, 2003 at 22:00 UTC | |
Re: Appending one array onto another
by Anonymous Monk on Jun 10, 2003 at 10:50 UTC | |
Re: Appending one array onto another
by Skeeve (Parson) on Jun 10, 2003 at 09:18 UTC | |
by sauoq (Abbot) on Jun 10, 2003 at 09:33 UTC | |
by Skeeve (Parson) on Jun 10, 2003 at 09:38 UTC | |
Re: Appending one array onto another
by TomDLux (Vicar) on Jun 10, 2003 at 14:35 UTC | |
Re: Appending one array onto another
by novitiate (Scribe) on Jun 10, 2003 at 14:52 UTC | |
Re: Appending one array onto another
by denthijs (Acolyte) on Jun 10, 2003 at 09:27 UTC |
Back to
Seekers of Perl Wisdom