in reply to Sort::Key::Natural sorting discrepancy
I am not familiar with the module but in the docs it says:
Which to my mind is correct. You might be able to use some variation of the Schwartzian Transform to achieve your desired output.
Spaces, symbols and non-printable characters are only considered for splitting the string into its parts but not for sorting. For instance foo-bar-42 is broken in three substrings foo, bar and 42 and after that the dashes are ignored.For the examples you give the sort order would then be:
P | 007 | B | YUM |
P | 007 | YUM |
P | 007 | Yum | |
P | 007 | b | Yum |
P | 007 | b | yum |
P | 007 | yum |
Which to my mind is correct. You might be able to use some variation of the Schwartzian Transform to achieve your desired output.
|
---|
In Section
Seekers of Perl Wisdom