# for @foo with 100,000 elements, this sort eats 12k of memory @foo = sort { $foo->{bar} cmp $foo->{bar} } @foo; # but for the same foo, this sort eats 90M ! @foo = sort @foo; @foo = sort { $a cmp $b } @foo; # equivalent