In Perl, how can I check from which module a given function was imported?
问题 I have a code which calls the function. But I don't know the module this function belongs to. I need it to modify this function. How can I check it? 回答1: The Devel::Peek module is very handy to get all sorts of information about variables. One of the things you can do with it is dump a reference to a subroutine and get the name of the glob it came from: $ perl -MDevel::Peek -MList::Util=first -e'Dump(\&first)' SV = IV(0x1094e20) at 0x1094e28 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x11183b0 SV =