in reply to query for methods?

Is there way to determine method/function names for loaded module?
Yes there is and it's the can method which is attached to every object. Here's a short example of how to use it
package Foo; sub new { bless {}, shift } sub foo { print "i'm a method of Foo\n" } package main; my $o = Foo->new(); print "foo exists\n" if $o->can('foo'); print "bar does not exist\n" unless $o->can('bar'); __output__ foo exists bar does not exist
For more info on can check out the special UNIVERSAL package.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: query for methods?
by ph0enix (Friar) on Jul 03, 2002 at 09:53 UTC

    This way can be used when I have some idea about function name:) I want to obtain list of all functions - don't know function names...

      Then just dump the symbol table of your given package either by hand or using Juerd's Devel::GetSymbols. If you want to roll you own something like this ought do the trick
      package Foo; our $VERSION = 0.1; sub new { bless {}, shift } sub foo { print "i'm a method of Foo\n" } package main; for my $sym (keys %Foo::) { print "method - $sym\n" if *{"Foo::$sym"}{CODE}; } __output__ method - foo method - new

      HTH

      _________
      broquaint