package Foo { use strict; use warnings; sub new { my ( $class, $foo ) = @_; bless \$foo, $class; \$foo; } sub foo { ${ (shift) }; } 1; } package Bar { use strict; use warnings; use parent qw(Foo); my $modify = sub { uc shift }; # my $modify = sub { ... }; sub bar { # my ( $self, $foo ) = @_; $modify->( shift->SUPER::foo() ); } 1; } #!/usr/bin/env perl use strict; use warnings; use feature qw(say); use Bar; my $object = Bar->new(q(lorem ipsum kizuaheli)); say for ( $object->foo(), $object->bar() ); __END__