|
|
| There's more than one way to do things | |
| PerlMonks |
Re: How to duplicate every member of an arrayby davido (Cardinal) |
| on Jul 28, 2022 at 15:01 UTC ( [id://11145811]=note: print w/replies, xml ) | Need Help?? |
|
List::Util is a core module (ships with Perl). It provides the mesh() function, which can be used as follows:
It turns out to be really quick.
The output:
When I bump it up to 676 elements ('aa' .. 'zz'), the comparison is similar:
With 11756 elements ('aaa' .. 'zzz') the ratio holds. Dave
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||