>>>>> "j" == jerrykrinock <> writes:
j> On May 9, 12:37 pm, Ben Morrow <b...@morrow.me.uk> wrote:
>> You can do this with PadWalker.
j> Thank you. I haven't tried it yet, but documentation of PadWalker
j> from CPAN declares a var_name() function that seems to be exactly what
j> I want.
j> Apparently this was a tricky feat. From the documentation: "I
j> wouldn't recommend using PadWalker directly in production code, but
j> it's your call. Some of the modules that use PadWalker internally are
j> certainly safe for and useful in production."
j> And from a review: "PadWalker is really, really useful if you need to
j> debug something really, really weird. I hope you never have to use
j> this module, but if you do, use it boldly."
j>
j> Thanks for all the help. I'll probably give PadWalker a try next time
j> I am feeling bold, and have a little time to spare before production.
and i doubt you have a legit reason to need this in production code. i
smell an XY problem here. when someone needs to use such a dark magic
solution, i say the problem is poorly specified or similar. tell us what
the real problem is, don't ask how to do something requiring magic. i
can find no good reason (other than debugging or wacko stuff) for
needing the name of a variable. and if you have anon references, you
can't get any name.
uri
--
Uri Guttman ------
--------
http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training ---
http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ----
http://bestfriendscocoa.com ---------