in reply to Intercept subroutine calls
Add *WriteToLog = \&MyWriteToLog; after the declaration of MyWriteToLog (and after the declaration of WriteToLog as well, of course). I believe perldoc perlsub should cover this.