http://www.perlmonks.org?node_id=441593


in reply to Re: Sort on Number Embedded in String
in thread Sort on Number Embedded in String

Thanks friedo (and everyone else). I find your solution the easiest to understand. I know you didn't recommend the Schwartzian Transform for this problem, but I must read up on it since I've never even heard of it. It appears to be popular amongst the monks :-).

This place is great, in less then 30 minutes, I received a half dozen replies.
  • Comment on Re^2: Sort on Number Embedded in String

Replies are listed 'Best First'.
Re^3: Sort on Number Embedded in String
by Mugatu (Monk) on Mar 22, 2005 at 21:09 UTC
    The ST is a neat trick, and fun to learn about. In some cases, it is a very good optimization. But you should pay attention to friedo's comments. Often times the naive sort is fast enough that the overhead of the ST is not worth it, and it will almost always be easier to read than an equivalent ST.