in reply to Construct a data structure from a string

given a textual data structure description, I'd like to set up a nested Perl data structure, consisting of hashes and arrays.

As an aside, what you're doing looks very much what like the J2EE world (and now the Ruby on Rails framework) do to reconstitute object hierarchies from flat data in form posts. Perhaps that's what you intend this for.

What you've got looks like a decent start, though it can be confused by invalid input. E.g.,

foo.bar[baz].47

A few small adjustments can compensate.