in reply to Re: Why didn't this sort?
in thread Why didn't this sort?

I know this is a minor thing, but it's probably best to make sure that you use the same reference instead of making a new one. If $ouputRef was pulled from a blessed object, for example, then this reassignment creates a new instance that isn't linked in.

Assign back to the same reference just to be safe:
@$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);