Hi exilepanda,
Where are the strings you're putting into eval coming from, are any of them based on user input? If so, you'll have to be very careful to sanitize the user input, otherwise you may be exposed to serious security issues. String eval also has some other disadvantages (syntax errors not detected until runtime, and it's not particularly fast), which is why it's usually discouraged and there are other ways to write the code you're writing. Only if you're sure none of the aforementioned issues are a concern in this case, string eval could be used.
Although it's possible to write some data-walking code without string eval by hand (in which it'd be helpful if you could show some more test cases of what you're trying to to do), maybe in this case the module Data::Diver could be useful to you?
Hope this helps,
-- Hauke D
In reply to Re: How to get a reference from an eval() string?
by haukex
in thread How to get a reference from an eval() string?
by exilepanda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |