package shapes; #constructor sub new { my ($invocant, %hash) = @_; my $class = ref($invocant) || $invocant; my $self = { shape => $hash{'shape'}, }; return bless $self, $class; } sub print_shape { my $self = shift; print $self->{'shape'}->{'line1'} . "\n"; print $self->{'shape'}->{'line2'} . "\n"; print $self->{'shape'}->{'line3'} . "\n"; } 1;