package BaseModule; use strict; use Exporter; our @ISA = qw( Exporter ); our @EXPORT = qw( function1 ); our @EXPORT_OK = qw( function2 ); sub function1 { print "Responding from Function 1\n"; return 1; } sub function2 { print "Responding now from Function 2\n"; function1(); return 1; } 1; #### #! /usr/bin/perl use strict; use warnings; use BaseModule qw( function1 function2 ); use Sub::Install qw( reinstall_sub ); reinstall_sub ({ code => 'overridden', into => "BaseModule", as => "function1", }); sub overridden { print "I am the overridden function\n"; function1(); } function2(); exit;