my @array = qw(one two three four five six seven); @newArray = myFunc(\@array, 4, 1); print join(', ', @newArray); # should give us: one, five, two, three, four, six, seven