in reply to Re: OO Perl: Nested classes question
in thread OO Perl: Nested classes question

Too verbose.
sub condition { my $self = shift; my $condition = shift or die "missing condition"; $self->{_condition}{$condition} ||= new Condition; }
We're building the house of the future together.

Replies are listed 'Best First'.
Re^3: OO Perl: Nested classes question
by TheMarty (Acolyte) on Sep 11, 2006 at 11:45 UTC
    Thanx to All... I think the solution of my problem was the usage of the hash to store new classes, which is especially elegant solution below:
    $self->{_condition}{$condition} ||= new Condition;
    Actually I did solved the problem with some Java-Collegue, who pointed my mistake, but not so elegant way (I used two methods, one for adding new class, another for setting / getting it's values).