dragonchild has asked for the wisdom of the Perl Monks concerning the following question:
So, I'm thinking about this and I came up with a number of possible solutions.
sub isRequired { my $self = shift; my $attr = shift; my $class = ref($self) or croak "No class name!\n"; no strict 'refs'; return (${"$class::Required"}{$attr}); }
sub isRequired { my $self = shift; my $attr = shift; return ($self->{Required}{$attr}); }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Interesting OO/package conundrum...
by tye (Sage) on Oct 12, 2001 at 01:02 UTC | |
|
Re: Interesting OO/package conundrum...
by premchai21 (Curate) on Oct 11, 2001 at 23:15 UTC | |
|
Re: Interesting OO/package conundrum...
by runrig (Abbot) on Oct 12, 2001 at 01:12 UTC | |
|
(jeffa) Re: Interesting OO/package conundrum...
by jeffa (Bishop) on Oct 12, 2001 at 01:12 UTC | |
by t'mo (Pilgrim) on Oct 12, 2001 at 17:37 UTC | |
|
Re: Interesting OO/package conundrum...
by pike (Monk) on Oct 12, 2001 at 15:13 UTC | |
by dragonchild (Archbishop) on Oct 12, 2001 at 16:49 UTC | |
|
Retitle this thread: cannot access class data of derived classes in parent method
by princepawn (Parson) on Oct 12, 2001 at 19:58 UTC |