First you need to find out from which package the routine came from. The Perl Hacks book in Hack # 58, "Finding the Source of a Subprogram," recommends the Sub::Identify module.
use Sub::Identify ':all'; print stash_name ( \&YOURSUBROUTINE );
This will print the package from which the subprocess comes.
Hack # 55 "Show Source Code on Errors" shows how to get source code based on line numbers (from error messages and warnings). Code examples can be found here: code example
source share