... use Devel::Peek; .... print Dump( $bottom ); my $middle = int(($bottom + $top) / 2); print Dump( $bottom ); ....