In Re: Validating a Code Reference I mention my favorite, Devel::Peek::CvGV(), which I just tested and using it on \&main::ImportedFunction appears to give you the original package name.
You could also try some of the other solutions mentioned in that thread.
Update: Now that I got first post (j/k), here is some tested code:
which prints "*Devel::Peek::CvGV" then "CvGV came from Devel::Peek." - tye (but my friends call me "Tye")#!/usr/bin/perl -w use strict; use Devel::Peek "CvGV"; my $x= CvGV(\&CvGV); print "$x\n"; $x =~ s/^\*//; $x =~ s/::[^:]+$//; print "CvGV came from $x.\n";
In reply to Re: Can I find out which package a subroutine is from, originally?
by tye
in thread Can I find out which package a subroutine is from, originally?
by nate
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |