Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
hat's a Schwartzian Transform, right? It is. In short: by creating a datastructure that you store together with the original string, you don't have to re-build the original string and don't have to take apart the string at every iteration. After replacing $A =~ /\D/ || $B =~ /\D/ with $A !~ /\d+/ || $B !~ /\d+/ (is there a better way?), it worked. Your correction was correct. You can actually even drop the plusses. I'll update my code right away. I am, however, wondering about "1abc" coming before "123DEF" (and the other "123...")
As I see it, that is correct. Integers should be used as such, according to your definition. That was the challenge :) First, the string is split to integer and non-integer parts, and then they are compared to eachother.
In reply to Re: Re: Re: Dictionary-style sort a la Tcl?
by Juerd
|
|