Don't mean to pour water on your fire, but doesn't this do what Text::DelimMatch already does? I'd tend to go with the CPAN solution (and in fact I do use it in production code from time to time) as it's more complete and no doubt deals with a gotcha or two that you haven't yet encountered.
In reply to Re: parse nested text
by grinder
in thread parse nested text
by adoupas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |