in reply to Dynamic variables and strict

Just because you can do something with other tools, doesn't mean that you do it in Perl in the exact way. In fact, you can achieve the same result in a absolutely different way as shown by many monks above. While in some (very rare, IMO) circumtances it may be convenient to do what you intended, and it's truly prove of TMTOWTDI, but when we're talking about Real Code, turning arbitrary strings into distinct variables is just not the way. I personally think of it as an evil trap, would give much headache for me. They will clutter your code, after all.

Again, yes, you can do that in Perl. But, you can do it not because Perl encourages to do so. You can do it because the powerful way to do it (eval) is designed to do much more useful and flexible stuff, yet leads to disaster if used improperly. Don't you just realize that "eval" is only a byte away from "evil"? ;-)

As to solution for your Real Problem (assuming it's really about configuration parsing), I would prefer to search on CPAN for various Config packages.


Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!