in reply to find closest element of array without going over
It seems incorrect to print 100 when the input is 0. Beware backing around the corner of Perl's arrays.
Be well, rir