I
iris.a.jackson
Hi,
I am trying to find out how to create a variable in Perl whose value is
the name of the package it has been defined in. I haven't been able to
find the answer by Googling around.
Specifically, I'd like to be able to write Perl code like this:
=====
package My::Cool:
kg;
our $name = $XXX;
=====
[obviously $XXX would be replaced by some funny-looking thing that I
still need to learn] and I'd like $name to be assigned 'My::Cool:
kg'
when the file containing this is loaded. I would like to have this
available before any objects of class 'My::Cool:
kg' are created.
Thank you!
I am trying to find out how to create a variable in Perl whose value is
the name of the package it has been defined in. I haven't been able to
find the answer by Googling around.
Specifically, I'd like to be able to write Perl code like this:
=====
package My::Cool:
our $name = $XXX;
=====
[obviously $XXX would be replaced by some funny-looking thing that I
still need to learn] and I'd like $name to be assigned 'My::Cool:
when the file containing this is loaded. I would like to have this
available before any objects of class 'My::Cool:
Thank you!