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.
Basically, I want to create functions like:
sub foo {
my $self = shift (@_);
my $name = decode_blessing ($self);
}
Does that
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.
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?
Debugging. I have a function that writes errors / warnings / errata to
logs. Sometimes it could be more transparent if I included things like
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
Dan Anderson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
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?
Debugging. I have a function that writes errors / warnings / errata to
logs.