When I referred to “NDAs,” I am referring to source-code, written for a previous job, that I either no longer possess or cannot disclose. Whereas in most cases I have been able to finish the job with an archive of code that I created for that job, this is not one of those cases. Therefore, I cannot provide examples ... and, even if I could, they would not exactly be of the sort that I could meaningfully enclose within <code> tags for the edification of the present audience.
While I acknowledge the possible applicability of Text::Balanced, and do fully understand this module, I personally do not believe that “it is the approach that I would select.” In my opinion, the most-appropriate description of a problem of this kind is found (only) in a grammar, which expresses the input-text in question as an expression of a programming language and which facilitates the use of a tool that parses the content in these terms. “Balanced text” is a less-generalized approach which “might work just fine, 95% of the time.” But, under which, “you might never know of the other 5%.”
Now, here is where I am going to retreat: “this-here worked for me, and I think it worked amazingly well, therefore I
stuck my head out from above the PerlMonks trenches and dared to suggest(ed) it. But now I do admit that I am beginning to regret that decision. Do you folks really just want to hear yourselves talk? This site used to be a forum.