Is there a CPAN module for parsing nested parentheses?
Is there a CPAN module that can read a line like this:
"[[<asdf>, <foo>], (abc, def, ghi), ({'jkl'})]" ... and disassemble it into some kind of tree structure that is easy to move and beautifully printed?
I think you could build on top of Text :: Balanced , which will do a lot of hard work for you. However, you still need to build a tree structure.
Perl 5.10 regular expressions can handle balanced structures. See Section (?PARNO) (?-PARNO) (?+PARNO) (?R) (?0) in perlre .
Perl 6 will have built-in tools to support this. At the same time, Text :: Balanced (as Dave Rolski mentioned) is probably the module of choice. Please note that this was also written by Damian Conway (as expressed by Bill Carvin).
Damian Conway Parse :: RecDescent
I have not used this, but it is a good bet that the Perl module written by Damian Conway is worth using.
If the string is identical to the Data Dumper format, then it can be eval -returned to the original structure.