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
For more info on can check out the special UNIVERSAL package.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
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: query for methods?
by ph0enix (Friar) on Jul 03, 2002 at 09:53 UTC | |
by broquaint (Abbot) on Jul 03, 2002 at 10:00 UTC |