The key is to use eval in string form.
It really almost never is. String eval is great if you want to generate code from something that looks like code it's a lot less great if you want to generate data structures. Your code is pretty susceptible to errors if @array happens to contain certain characters. Also, it's extremely inefficient to use the compiler for this kind of thing.
In reply to Re^2: Building Multi-Level Hash dynamically
by Joost
in thread Building Multi-Level Hash dynamically
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |