in reply to Search for consecutive flush left curly braces

May I also cautiously suggest that you might be “implementing a language parser, the hard way.”   The CPAN library contains both very-powerful lexers/parsers that are written in Perl, and interfaces to well-known legacy systems.   Perhaps by using one of these tools you can dramatically change (for the better ...) your approach to this problem.   Several LALR-grammars for the C++ language, for example, are already available off-the-shelf.

Replies are listed 'Best First'.
Re^2: Search for consecutive flush left curly braces
by ExReg (Priest) on Jun 11, 2015 at 13:52 UTC
    As much as I like CPAN, I cannot load any of it on to the workstations at work. I am stuck with what I have and any other needed functionality has to be created by me. At least they finally upgraded from Perl 5.005!