![]() |
|
go ahead... be a heretic | |
PerlMonks |
Re: Can you find the name of a variable?by afoken (Chancellor) |
on Nov 14, 2009 at 10:57 UTC ( #807126=note: print w/replies, xml ) | Need Help?? |
If you want to know the name of a variable, you usually try to do something stupid. Most times, the answer is to use a hash instead. Also in this case, you can use a hash to get named parameters instead of positional parameters. Something like this:
Back to the "what's the name of the variable problem". What should a hypothetical nameThatVariable() function return for the following cases?
Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|