Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I agree completely with AnomalousMonk's post here: Re^3: reference to an undefined key. There *are* ways to do what you want (and we could definitely point them out), but it would involve using magic that isn't advised for standard use cases. Trying things out is one thing, but for code you're going to use, it's best to use idiomatic Perl that you, and anyone in the future can read easily at a glance six months after it is written. If you want to force your will upon a data structure creation, you'll want to look at symobolic references, and understand the symbol table. There's a decent intro here on PM: Of Symbol Tables and Globs. Again though, using magic to do things in a non-conventional way often leads to bugs that are "far away" or "at a distance" from the code that uses said magic, while leaving code that yourself, or others might not be able to comprehend in the future (even after a lot of review and tracing). With all those warnings stated, we don't learn how to force perl to do things unconventionally without pushing our limits of what we know. In reply to Re^3: reference to an undefined key
by stevieb
|
|