Generally speaking, there's no good reason that comes to mind for why you would need to get the name of a variable during runtime. The compiler doesn't care about names at all. They exist only for your benefit. If your program needs to know the *name* of everything that could possibly be created at runtime, you'll have trouble going beyond a hundred lines of code.my $data = "you are hearing me talk"; sub show_data { my $d_ref = shift; print $$d_ref; } show_data{\$data);
As long as you can get to variables in hashes or arrays or even objects and other complex data structures, you don't need to know the names. You probably do need to understand references, so bone up on perlref and perlreftut.
Now if you're providing a serialization mechanism or pretty printer, there's a different story. But that doesn't seem like what you're doing here. Did I completely misunderstand your question?
In reply to Re: stringification
by chromatic
in thread stringification
by dash2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |