RSS | Module Info | Add a review of Sort-Naturally
Sort-Naturally
(1.02)
This is one of those modules that does only one thing and does it well: compare numeric substrings as numbers, and characters as characters. You "use" it, replace "sort" with "nsort", and it works like a charm. Nice!
Aaron wrote in his review that 'The results of Sort::Naturally were not what I expected. For example, "AZZZ3827Q" sorts ahead of "A1".'
The rationale for this is documented on the module's POD:
"When comparing two strings, where a numeric substring in one place is not up against a numeric substring in another, the non-numeric always comes first."
Even the synopsis code already presents this to the potential user, ordering elements as:
qw(9x 14 foo fooa foolio Foolio foo12 foo12a Foo12a foo12z foo13a)
So I really don't understand the poor rating. That said, the documentation for this module *can* be a little too confusing for such a simple purpose and contains a few typos. There is even (by the time of this writing) a two-year old ticket regarding them, which is why I gave this module 4 stars for documentation.
Breno G. de Oliveira - 2010-12-28T06:37:07 (permalink)
3 out of 3 found this review helpful.
Was this review helpful to you?
Yes
No
Sort-Naturally
(1.02)
The results of Sort::Naturally were not what I expected. For example, "AZZZ3827Q" sorts ahead of "A1".
Aaron Priven - 2009-10-08T10:45:31 (permalink)
0 out of 2 found this review helpful.
Was this review helpful to you?
Yes
No
Sort-Naturally
(1.02)
I used this to sort network device interface names (GigabitEthernet9/2, ge-2/1/0.432, A24, etc.) and it sorts just how I would like it and saved me a lot of hassle.
Mitch McCracken - 2009-08-04T08:13:31 (permalink)
5 out of 5 found this review helpful.
Was this review helpful to you?
Yes
No
Sort-Naturally
(1.02)
Sort::Naturally helped me get rid of about 25 lines of hard-to-read code sorting complex alphanumeric strings. nsort worked perfectly out of the box, without my needing to worry about configuration or special options.
Anirvan Chatterjee - 2009-04-13T18:31:38 (permalink)
7 out of 7 found this review helpful.
Was this review helpful to you?
Yes
No
Sort-Naturally
(1.02)
A very easy to use module that does what you would naturally consider right ( naturally meaning what you most likely have been taught to do). Don't bother writing your own sorting if this one fits the bill.
A look at the code shows a strange construct but I guess the author had good reasons (speed?). Anyway I'm interrested in how to use it not how it is build and using it is simple.
نديم الخمير - 2007-02-09T04:42:05 (permalink)
3 out of 5 found this review helpful.
Was this review helpful to you?
Yes
No

