in reply to Re^2: Constructing complex numbers using recursion
in thread Constructing complex numbers using recursion

Grandfather is right -- this is the extreme opposite of clarity.

You definitely want to start over, and Grandfather's code is a good place to start. Programming hint: if you had structured your original "constructComplex" sub so that it keeps its two input args in an array and loops over each array element, you would have had about one half as many lines of code. That's true no matter what language you think in. And once you get used to thinking in Perl (and learn something about regexes), you'll be able to shorten -- and clarify -- the code quite a lot more.

  • Comment on Re^3: Constructing complex numbers using recursion