my @newdeck= shuffle(@starting_deck); sub shuffle { my @cards= @_; foreach (1...30) { my @cut= pop(@cards), shift (@cards), pop(@cards) ... ... push @cards, @cut; } ... return @˘ards; }