@doubled = map { ($_) x 2 } @array
FWIW, you could of course also do
@doubled = (@array) x 2
but the order would be different.
a b c d a b c d
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re: How to duplicate every member of an array
by LanX
in thread How to duplicate every member of an array
by soblanc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |