|Problems? Is your data what you think it is?|
Thanks. I think you are right regarding the re-use of a modified lvalue ref.
Whilst your code achieves the notionally "desired" output of the testcode I posted, as I said, this is a simplification.
The real application could be recursing into multiple substrings of the parameter at each level. Where and when the recursion occurs is dependant upon the content of the (sub)string passed and cannot be easily codified into a regex. For various reasons I wish to avoid using the regex engine also.
That said, I may not have those choices now.
Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.
In reply to Re^2: Scalar refs, aliasing, and recursion weirdness.