use strict;
use warnings;
use parent 'ParentClass';
sub new {
my $class = shift;
my %options = @_;
my $self = $class->SUPER::new(@_);
$self->{my_option} = 1 if $options{my_option};
return $self;
}
sub my_option {
my $self = shift;
$self->{my_option} = shift if @_;
return $self->{my_option};
}
sub overridden_sub {
my $self = shift;
my %args = @_;
if ($self->{my_option}) {
return do_my_logic_here();
}
return $self->SUPER::overridden_sub(@_);
}
No comments:
Post a Comment