in reply to Re: Why didn't this sort?
in thread Why didn't this sort?
@$outputRef = sort @$outputRef;These are "equivalent" in terms of functionality, but not in terms of effect. For an example of what I mean:
my $foo = [ [ 4, 1, 6 ], [ 4, 1, 5 ] ]; my $foo_0 = $foo->[0]; my $foo_1 = $foo->[1]; $foo_0 = [ sort @$foo_0 ]; # $foo_0 is "detached" @$foo_1 = sort @$foo_1; # Goes back into $foo->[1] use Data::Dumper; print Dumper($foo);
|
|---|