in reply to Re: [Study]: Searching for square roots
in thread [Study]: Searching for square roots

And remember that $a and $b are the special comparison variables for sort(). It's a bad habit to use meaningless variable names anyway - let's move on past FORTRAN!

I'd recommend maybe

sub middle { my($low, $high) = @_; return ($low + $high) / 2; }
because it's now much more evident that the "middle" is the value between low and high.