Schwartzian Transform
I just love perl. It's beautiful! Randal L. Schwartz, aka, merlyn, at perlmonks has got to be one of my favorite perl superstars! Anyway, I was over at his site reading his article on sorting *again*. Every time I read it I get those warm fuzzies all over. I'll probably never use the Schwartzian Transform, but dang, it's some slick crap!
my @output =
map { $_->[0] }
sort { $a->[1] cmp $b->[1] }
map { [$_, expensive_func($_)] }
@input;
Speaking of perl, I'm looking forward to the houston perlmongers meeting tonight at HAL-PC!
1 Comments
Support this site by opening up a hosting account with site5.com



Visiting from MT forums. I agree about the world being a better place without those DHTML scrolly doo-dads ... as well as without Java craplets I might add.
AND, I agree about PERL, and Schwartz. I thought the funniest Larry Wall quote was in one of the O'Reilly books where he's talking about the history of PERL, he says something like "Larry Wall was asked to synchronize the vaxen on the East and West Coasts, so he called upon his three virtues: laziness, impatience, and hubris ... etc etc" I'm still laughing at that.
And Steven Wright too!
So, anyway, glad there are a few folks like you out there with good taste! Keep up the good work.