in reply to octtree using hashes

sub build_rec { my ($self, $middlex, ...) = @_; my $middlex /= 2; ...; if ($middlex <= 1 or ...) { return; } ...; }

Do yourself a big favor and use warnings and strict. Even if these modules do not explicitly identify all of them, they will at least alert you to many questionable practices in your code:

c:\@Work\Perl\monks>perl -MData::Dump -le "use warnings; use strict; ;; my $br = build_rec(100); dd 'build_rec returned', $br; ;; sub build_rec { my ($middlex) = @_; ;; my $middlex /= 2; if ($middlex <= 1) { return; } ;; print qq{did not return. will do something useful.}; return $middlex * 1_000; } " "my" variable $middlex masks earlier declaration in same scope at -e l +ine 1. Use of uninitialized value in division (/) at -e line 1. ("build_rec returned", undef)
See also diagnostics for (much) more verbose messages.


Give a man a fish:  <%-{-{-{-<