in reply to Re: weird subroutine behavior
in thread weird subroutine behavior

Good news.
I replaced the hash with an array and the results were at least consistent.
I analyzed the output and I found a flaw in my algorithm. I fixed the algorithm and the program works fine now.
However, the weird behavior remains, ... maybe as a meditation.

Thanks a lot.

Replies are listed 'Best First'.
Re^3: weird subroutine behavior
by jdporter (Paladin) on Apr 03, 2008 at 23:51 UTC

    Excellent! Would you mind posting your updated code?

    However, the weird behavior remains,

    I assume you mean it remains in the original code, but not in your new version, right?

      Modifications:
      - I commented out the second for loop in the subroutine since it was redundant and overlapping
      - I changed the type of "substrings" from hash to array as you suggested.
      Please see below the modified code:

      Regarding the previous version, the weird behavior remains.