Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: query for methods?

by ariels (Curate)
on Jul 03, 2002 at 09:26 UTC ( #179106=note: print w/replies, xml ) Need Help??


in reply to query for methods?

The debugger command `m' shows "methods" defined for a package, so you certainly can do it.

How? Look for functions referenced in the %{PACKAGE_NAME::} hash. Here's an example...

#!/usr/local/bin/perl -w # Find all functions in specified package my $pkg = shift; eval "use $pkg; 1" or die "Failed to load $pkg: $@\n"; # print functions while (my ($key, $val) = each %{"${pkg}::"}) { print "$key\n" if defined *{$val}{CODE}; }
Run giving a package name as argument.

Note that we're using some symrefs here (to access the %{"${pkg}::"} hash), so as least that line should be free of strictness.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://179106]
help
Chatterbox?
[Your Mother]: marto++ (me as well)
[zentara]: choroba I stand corrected, I guess Jesus killed a tree once too.
[erix]: the neighbours (a nat.hist. museum) have a narwhal skull with *2* tusks
[erix]: ( also: UniCorn Throne )
[zentara]: erix I hope both tusks pointed in the same direction :-)
LanX "♪..♫ Last night a DJ killed my wife ♪..♫ "

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2017-03-30 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (361 votes). Check out past polls.