in reply to Sorting of numbers using arrays

guessing you mean something like

my @values = qw(1452 6351 5892); # here is some perl code that converts @values to 1245 1356 2589

of course you can use sort, just together with split and join :)

Replies are listed 'Best First'.
Re^2: Sorting of numbers using arrays
by Anonymous Monk on Sep 20, 2010 at 19:48 UTC
    No need for split or join in that case...

    map { scalar reverse } @values

      use strict; use warnings; my @values = qw(1452 6351 5892); @values = map { scalar reverse } @values; print "@values ";

      prints 2541 1536 2985, so it's just reverting but not sorting the strings. I just wanted to point ot that you can use sort.