Questions tagged [class-attribute]
18 questions
0
votes
1 answer
"Odd number of hash elements" when declaring MooseX::ClassAttribute
On OSX 'Mavericks', this:
package FOO;
use Moose;
use MooseX::ClassAttribute;
class_has 'BAR' => ( is => 'rw' );
... checks clean per 'perl -c':
FOO.pm syntax OK
... but gives this error if I run it simply with 'perl FOO.pm':
Odd number of…

amp108
- 432
- 3
- 14
0
votes
4 answers
How can I access a class data member from a method within the same class?
class Class:
_member = 1
def method(self):
I want to access _member from within method(), what is the correct way to do so?

Quaker
- 1,483
- 3
- 20
- 36
0
votes
3 answers
How to reference a class method in a class attribute?
In a package, I have isolated a set of functions/variables that work altogether in a class. As these functions did not require a specific context, they became class methods. They may use some external functions, here represented by the save_c…

Guillaume Lemaître
- 1,230
- 13
- 18