in reply to Re: Sorting an array of strings by number
in thread Sorting an array of strings by number

True. But I don't think anyone has mentioned that this will generate warnings. But you can turn them off around that part of the code:

my @sorted= do { local( $^W )= 0; sort { $a <=> $b } @data; };

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re: Sorting an array of strings by number
by Fletch (Bishop) on Oct 03, 2001 at 21:35 UTC

    Or if you're using a 5.6 or newer perl you can turn off just warnings about the numericness (see perllexwarn for more information).

    my @sorted = do { no warnings 'numeric'; sort { $a <=> $b } @data ; };
      Cheers guys, thats exactly what I needed to do.