On Tuesday, Nov 18, 2003, at 14:27 US/Pacific, James Edward Gray II wrote:
On Nov 18, 2003, at 4:23 PM, Dan Anderson wrote:

Is it possible to create self aware functions (possibly using a magic
variable)?  I.e. functions that know their own name.  Sort of the
oppossite of bless.

You're looking for ref(), but first let me give you the "This is often a bad idea" warning. What are you trying to use the object's name for?

yes and no actually. { most of the time I TOTALLY agree with you on this point, so, well, uh... there is a time when it is useful }

He may also want to deal with say

perldoc -f caller

since sometimes it is nice to have things like

we were in main, Foo::Bar::me_called, 14

the demonstration code is up at:
<http://www.wetware.com/drieux/PR/blog2/Code/200311.html#id3152014937>

ciao
drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to