You can use CPAN module, such as List::BinarySearch instead of writing code yourself.
Also, instead of using min and max you could use $array[0] and $array[-1] - the list is sorted.
Also, as far I can see, you check if value is out of bounds every time loop passes. You can move this check outside loop.
In reply to Re: Improve my lookup script
by GlitchMr
in thread Improve my lookup script
by jjap
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |