From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

use strict;
package Mockee;
sub good ($$);
sub good ($$) {
my ( $bar, $baz ) = @_;
return ( $bar + 1, $baz + 2 );
}
1;
package main;
$INC{'Mockee.pm'} = 1;
my $mocker = Test::MockModule->new('Mockee');
$mocker->redefine( 'good', 2 );
done_testing();
#----------------------------------------------------------------------