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


in reply to Numeric Sorting on Characters

Hmmm... the presence of a single “-” seems quite suspicious to me ... have you looked at the corresponding record in the input data, and if so, is it really just a dash?   Does this look like a possible bug in the program that produced the file?   (Hey, it happens ... a lot.)

“Making the immediate bug go-away” sometimes leaves you in a situation that is much worse.   Why is that dash there?   Is it really there (or is your parsing algorithm insufficient?).   Is it really correct to code your program to detect and to accept it?   Maybe the proper answer to all 3 questions is yes.   But then again, the software might be trying to tell you something.