Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Sort::Key::Natural sorting discrepancy

by tangent (Parson)
on Nov 01, 2017 at 01:57 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 23:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found