Hi Ken

I just wrote this

https://gist.github.com/andrewsolomon/65b795be10da569f878d

and then realised it could be simpler because you'll have a tab between the
number and string. Does this give you enough to work off?

Andrew




On Tue, Mar 8, 2016 at 9:29 PM, Kenneth Wolcott <kennethwolc...@gmail.com>
wrote:

> Hi;
>
>   How do I call the built-in Perl sort function on an array of strings
> where the string is composed of one or more digits, followed by a tab
> which is followed by a string and I want the results to be sorted in
> reverse numeric order?
>
>   I looked at http://perldoc.perl.org/functions/sort.html and I still
> don't know the right answer to this question.  I suppose if I disable
> warnings, then it works ok?
>
>   The GNU sort (Cygwin/Linux) function does not complain about numbers
> followed by strings for the data when requested with reverse sort and
> just does it.
>
>   The "$b <=> $a" option to sort seems to complain about the strings
> in the data, but the output is correct.
>
> Thanks,
> Ken Wolcott
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>


-- 
Andrew Solomon

Mentor@Geekuni http://geekuni.com/
http://www.linkedin.com/in/asolomon

Reply via email to