http://www.perlmonks.org?node_id=1028537

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

Hello, I don't understand why in the call #2 below the arguments of the call do not "arrive" in the subroutine, I guess due to the use of sort.
Thanks in advance for clarifying this to me.

use strict; use Data::Dumper; use warnings; my @orig_values = (1,3,2); # 1 my @values = arraynosort(Values=>\@orig_values); print join(",",@values),"\n"; # 2 @values = sort arraynosort(Values=>\@orig_values); print join(",",@values),"\n"; sub arraynosort { my %args = @_; print Dumper \%args; my @values = @{$args{Values}}; return @values; }