in reply to Re: recursive split
in thread recursive split

Thanks for your reply. Actually, I need those passes to look like the way as shown above so that I can do some processing to the content within the parenthesis if required at each recursive step. I tried shellwords but that also does not work here.

Replies are listed 'Best First'.
Re^3: recursive split
by SuicideJunkie (Vicar) on Sep 03, 2009 at 19:07 UTC
    Sounds like you want a queue of things to do next then.
    • List of things to process in the next iteration = startstring
    • While there are things to process in the next iteration
      • things to process this iteration = things to process next iteration. Things to process next iteration = ()
      • while things to process this iteration
        • shift list of things to do this iteration, and split that thing
        • ponder the split thing and print any revelations.
        • add to the list of things to process next iteration if appropriate
    You probably don't want to do recursion if you want to print everything from one level before moving on to the next.