cgoolsby has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, This question is more of a interesting concern. I have some modularized code. In this code, I pass an array reference to a function which returns a different array as a reference. i.e.:
use ModuleName qw(moduleFunction); @arrayPassedIn = qw(some values here); #there are 9 values, to be specific. $return = moduleFunction(\@arrayPassedIn); @arrayToPrint = @$return;
For reference to module function looks like:
sub moduleFunction{ $input = shift; @arrayToBeManipulated = @$input; #manipulations occur here producing a new array with 6 values; @newArray = qw(6 unique values); return \@newArray; }
So here is the kicker. When I print @arrayToPrint, I get the 6 values that I desire, and then the last 3 values of the array I passed into my function. Is this as intended? Am I doing something wrong? It doesn't effect my code, because I just discard these values, but I am curious what is going on.
P.S. this is my first post on here. If I am violating any rules, I apologize in advance. Also, if you see a simple way I can improve my conventions for coding, I am largely self-taught and happy to learn and improve!