As the title says, I\'m not clear on when such a subroutine will be called. From the require page at perldoc one can write:
push @INC, \\&my_sub; sub my
To avoid confusing our subroutine with the subroutines in the standard Perl modules generally it is good to use the unshift instead of push. So it will first use your subroutine from the @INC.
unshift
push
@INC