in reply to Identify subs and their source

Regarding I'm not sure how to distinguish the imported symbols from those defined in the target file., I've heard of something for that.

This is similar to what autoclean and Moose does.

I think if you use the Sub::Name module, you can find out the full name that the sub was declared in. That will tell you if it was imported.