use IO::All; my $file = io("somefile"); log(5, $file, "some error"); sub log { my ($file, $level, $message) = @_; $file->print($message) if $level < $DEBUG_LEVEL; } #### package Thingy; sub method { my $self = shift; $self->del->method($self, @_); } pakage Delegate; sub method { my $self = shift; my $parent = shift; # in here we completely ignore $self and do # lots of manipulation of $parent }