Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Can I find out which package a subroutine is from, originally?

by nate (Monk)
on Jan 03, 2001 at 07:22 UTC ( #49449=note: print w/replies, xml ) Need Help??


in reply to Re: Can I find out which package a subroutine is from, originally?
in thread Can I find out which package a subroutine is from, originally?

Dang, you so smoove!

Revised code as so:

use Devel::Peek "CvGV"; my $module = "Everything::Node::user"; #a bit of code clipped from the perl cookbook use no strict; local *stash; *stash = *{ "${module}::" }; #this is assuming the module has been "use"d -- which it has my @modfuncs; foreach(keys %stash) { my $glob = CvGV(\&{$stash{$_}}); $glob =~ s/^\*//; push (@modfuncs, $_) if defined &{ $stash{$_} } and $glob eq "$module\:\:$_"; } @modfuncs; #only the functions in my module!

And it works! Thanks...

--nate

  • Comment on Re: Re: Can I find out which package a subroutine is from, originally?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://49449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2018-08-18 16:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (185 votes). Check out past polls.

    Notices?