sub new_question { my $self = shift; my $class = ref $self; ( my $question_class = $class ) =~ s{::Quiz$}{::Question}; ( my $question_module = $class ) =~ s{::}{/}g; my $question = eval { require "$question_module.pm" } ? $question_class->new( @_ ) : NHB::QuizMaster::Question->new( @_ ) ; push @{ $self->questions }, $question; $question; }
In reply to Re: Calling chains, extends, and subclassing
by mreece
in thread Calling chains, extends, and subclassing
by EvanCarroll
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |