ackage MyParent; use strict; use Carp qw(carp croak); our $VERSION = .01; sub new { my $class = shift; my $self = bless { something => "foo", }, $class; return $self; } sub parent_nifty_method1 { my $self = shift; print $self->{something}; } sub parent_nifty_method2 { my $self = shift; #... pah ... } package MyParent::MyChild; use strict; use base qw(MyParent); our $VERSION = .01; sub new { my $class = shift; my $parent = $class->SUPER::new; my $self = bless { PARENT => $parent, }, $class; return $self; } sub child_method_a { my $self = shift; #read parent variable, not change it print $self->{PARENT}->{something}; } sub child_method_b { my $self = shift; #... incredibly cool stuff ... } package main; #use MyParent; #use MyParent::MyChild; #use strict; my $parentobject = MyParent->new(); $parentobject->parent_nifty_method1; #prints: foo #Now I want to access something or other in the MyChild, doing it this way (which is what inheritance means to me) my $childobject = MyParent::MyChild->new; $childobject->child_method_a; #Prints: foo 1; #### package MyParent::MyChild; use strict; use base qw(MyParent); our $VERSION = .01; sub new { my $class = shift; my $parent = $class->SUPER::new; # extend blessed reference $parent with a new field $parent->{another_something} = "bar"; my $self = bless $parent, $class; return $self; } sub child_method_a { my $self = shift; #read parent variable, not change it $self->parent_nifty_method1; } sub child_method_b { my $self = shift; print $self->{another_something}; } package main; #use MyParent; #use MyParent::MyChild; #use strict; my $parentobject = MyParent->new(); $parentobject->parent_nifty_method1; #prints: foo #Now I want to access something or other in the MyChild, doing it this way (which is what inheritance means to me) my $childobject = MyParent::MyChild->new; $childobject->child_method_a; #Prints: foo $childobject->parent_nifty_method1; #Prints: foo $childobject->child_method_b; #Prints: bar