We don't bite newbies here... much | |
PerlMonks |
Re: Ternary vs. Sort vs. Maxby shmem (Chancellor) |
on Aug 10, 2015 at 10:31 UTC ( [id://1138001]=note: print w/replies, xml ) | Need Help?? |
Just for the sake of TIMTOWTDI:
which is a golfed version of your 2nd variant: (sort-of) a one-step sort which eliminates building a code block frame and the call of sort. Ternary is cheaper, since it doesn't involve bulding a list. update:
- which is as cheap as ternary (I guess) but looks convoluted to me - among other hilarities. Good riddance.
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
In Section
Meditations
|
|