in reply to Help tightening up a subroutine please

I'm having kinda of a difficult time visualizing your data, but it looks like you are scanning over @sortedKeys multiple times. Could you rearrange the logic to scan outward from the current item instead of continually scanning over @sortedKeys?

If you could provide a small bit of code that actually uses this sub, giving it data and showing us the expected outcome it might be a fun challenge for some of us! ;) It could be a significantly smaller set of data than you are working with, just enough to show the input/output is working correctly.

Good luck!


___________
Eric Hodges
  • Comment on Re: Help tightening up a subroutine please

Replies are listed 'Best First'.
Re^2: Help tightening up a subroutine please
by mdunnbass (Monk) on Jan 24, 2007 at 16:24 UTC
    That's a very good point. Words can never describe things as well as what you can manipulate by hand. So, here's a very small sample input, with what the desired output should be. I hope this helps anyone interested in helping me out....

    Thanks to everyone who's responded so far. This has been informative.
    Matt