in reply to Module Data Dump.
Sounds like XML::Dumper.
I have it set up, so that it starts by taking an object, and then either asking if it has a certain function that returns allow of the methods that the person wants to store data returned from, or checking if the object is a hash, array, or scalar. I have not debugged it yet, and I want to know ahead of time will the code:
Not sure I understand the question. Are you asking how to find if object has some method? It is easy:
my $object = whatever; my $method = whatever; if($object->can($method)) { print "Has method $method\n"; } else { print "Has no method $method\n"; }
See perldoc UNIVERSAL.
--
Ilya Martynov
(http://martynov.org/)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Module Data Dump.
by dakedesu (Scribe) on Mar 27, 2002 at 20:25 UTC | |
by IlyaM (Parson) on Mar 27, 2002 at 22:58 UTC | |
by dakedesu (Scribe) on Apr 01, 2002 at 09:33 UTC | |
by IlyaM (Parson) on Apr 01, 2002 at 10:13 UTC | |
by dakedesu (Scribe) on Apr 01, 2002 at 10:17 UTC |