|
|
| Think about Loose Coupling | |
| PerlMonks |
Re: Re: Re:{2} Getting impossible things right (behaviour of keys)by demerphq (Chancellor) |
| on Oct 24, 2001 at 14:45 UTC ( #121071=note: print w/ replies, xml ) | Need Help?? |
|
If this is going to be at all robust (umm and work as desired, sorry Blakem) I would change the sort to the following: Your code doesnt actually sort the words by length. (Yes I _am_ deliberately storing the length before I quotemeta it.) :-)
Update Although IIRC perl will optimize the first into the second anyway, it does save about 10 chars or so.. Oh also for the curious this is more modern form of the Schwartizian Transform which is a very cool trick. Unfortunately I cant remember the name of this version, nor the link to the excellent document I read about it. Hopefully someone that does will post a reply.
Update2
DeMerphq / Yves
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||