package Redirector; my $new_obj; # Redirect all methods calls of object A to object B. sub redirect { my $new_obj = shift; my @methods = @_ || 'all'; } sub print { my $real_obj = shift; # Conveniently switch the object. $new_obj->print(@_); }