Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Sort::Key::Natural sorting discrepancy

by tangent (Vicar)
on Nov 01, 2017 at 01:57 UTC ( #1202490=note: print w/replies, xml ) Need Help??


in reply to Sort::Key::Natural sorting discrepancy

I am not familiar with the module but in the docs it says:
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:
 
P007BYUM
P007YUM 

 
P007Yum 
P007bYum

 
P007byum
P007yum 

 
Which to my mind is correct. You might be able to use some variation of the Schwartzian Transform to achieve your desired output.
  • Comment on Re: Sort::Key::Natural sorting discrepancy

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1202490]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2022-05-25 03:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (84 votes). Check out past polls.

    Notices?