package Child; use strict; use warnings; sub new { my ( $class, $value1, $value2 ) = @_; my $this = {}; bless $this, $class; $this->setValue1( $value1 ); $this->setValue2( $value2 ); return $this; } sub setValue1 { my ( $this, $value ) = @_; if ( defined $value ) { $this->{_value1} = $value; return 1; } return undef; } sub getValue1 { my $this = shift; return $this->{_value1}; } sub setValue2 { my ( $this, $value ) = @_; if ( defined $value ) { $this->{_value2} = $value; return 1; } return undef; } sub getValue2 { my $this = shift; return $this->{_value2}; } 1;