in reply to Can I find out which package a subroutine is from, originally?
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Can I find out which package a subroutine is from, originally?
by nate (Monk) on Jan 03, 2001 at 07:22 UTC |