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?
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?
You can pass to Sub::Identify::sub_fullname any subroutine reference and it will show you the module where this sub was defined:
use Sub::Identify qw/sub_fullname/;
sub foo {
print sub_fullname( \&foo ); # main::foo
print sub_fullname( sub{} ); # main::__ANON__
}
foo();
For details see Sub::Identify