If your lists are large, linear-search algorithms will be very slow. Your program and the one by thinker use linear searches. You can find points in a sorted list much faster with a binary search, which is O(log n). The Search::Binary module provides a generic implementation. (The learning curve for that module looks a bit steep, however.)
"binary_search" implements a generic binary search algorithm returning the position of the first record whose index value is greater than or equal to $val.