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.
|Replies are listed 'Best First'.|
Re^3: Scalar refs, aliasing, and recursion weirdness.
by sleepingsquirrel (Hermit) on Feb 05, 2005 at 01:14 UTC
by BrowserUk (Patriarch) on Feb 05, 2005 at 01:45 UTC