Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-29 06:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found