in reply to
in thread Sorting colon-delimited records
Hmm, comparing (split($a)) with (split($b)) was the first thing that popped into my mind, as well. But isn't that a waste of CPU cycles, splitting an element over and over again each time you wanna compare it to another? The other idea that popped into my head was extracting each "sortable" element once and storing them somewhere, (a few people had suggested a hash), so I guess it's a matter of speed or memory usage, no? For small data sets, this probably wouldn't be an issue, but maybe for larger data sets, it would. Unless the sort routine is more efficient than that, and it optimizes away rather nicely to avoid having to split the same string over and over.
Just babbling some random thoughts. Anybody have any random answers?
There are 10 kinds of people -- those that understand binary, and those that don't.