Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2018-05-22 03:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?