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


in reply to Re^2: Fastest way to sort a list of integers into 0,1,2,3,-3,-2,-1
in thread Fastest way to sort a list of integers into 0,1,2,3,-3,-2,-1

No, ikegami, what you wrote won't work, but perhaps, instead, you meant Tux' version. It's slower -- (un)packing per element rather than "en masse" into (from) single scalar.

  • Comment on Re^3: Fastest way to sort a list of integers into 0,1,2,3,-3,-2,-1

Replies are listed 'Best First'.
Re^4: Fastest way to sort a list of integers into 0,1,2,3,-3,-2,-1
by ikegami (Pope) on Feb 06, 2019 at 20:10 UTC

    Oh right. It would be

    @list = map { unpack 'j>', $_ } sort map { pack 'j>', $_ } @list;

    I knew I was tired and missing something.