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


in reply to Closest-value-in-list Golf!

Here's a 62 char solution, imploying half a schwatzian transform:
sub g{ #234567890123456789012345678901234567890123456789012345678901234567890 my$c=pop;(sort{@$a[1]<=>@$b[1]}map{[$_,abs($_-$c)]}@_)[0]->[0] }

Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain