in reply to How do I double up elements within an array?
I'm not sure what type of loop you tried, but this produces an array in the order you described:
use strict; use warnings; my @array1=(1,33,45,66); my @array2; for my $items(@array1){ push @array2,($items,$items); } for my $item(@array2){ print "$item\n"; }
|
|---|