for ( 0..@states-1 ) { my $state = shift @states; splice @cities, ( @cities-@states)+1, 0, $state; }