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


in reply to Re (tilly) 1: Closest-value-in-list Golf!
in thread Closest-value-in-list Golf!

how come you use ( ) on one abs but not the other? :-)
sub g {(sort{abs$a-$_[1]<=>abs$b-$_[1]}@{$_[0]})[0]} # 44 chars
Update:
pop and no ref...
sub g {$n=pop;(sort{abs$a-$n<=>abs$b-$n}@_)[0]} # 39 chars
fantastic - that's exactly half my original

"Argument is futile - you will be ignorralated!"