my $_tsub = "SendMultiPartMemberEmailMimeLiteSendGrid"; if(exists &{$_tsub}) { # send code to call it... } else { require "/path/to/the/file/SendMultiPartMemberEmailMimeLiteSendGrid.pl"; # send code to call it now that we pulled it in... }