http://qs1969.pair.com?node_id=428261


in reply to Re: Scalar refs, aliasing, and recursion weirdness.
in thread Scalar refs, aliasing, and recursion weirdness.

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.