Hi,

This question is related to OOPs in Perl and I am learning and
enjoying it gradually.

Anyways I want to know is there any function or a way that would
reveal all the properties of the object.

For example if I have a package say Foo::Bar. Now assume that there is
a object called $fob and pretend that I don't know that its an
instance of Foo::Bar

There are many occasions while reviewing someone else's code that I
want to know the object properties like (Package to which it belongs,
sub routines I can execute using it etc)

So I am looking for some function that can print that.

Following is a snippet of my hypothetical idea.

EG:
use strict;
use warnings;
use Data::Dumper;
use Foo::Bar;
my $fob = Foo::Bar->new(); #pretend that I don't know this
my %obj_prop = some_function($fob)
print Dumper(%obj_prop); # This should print all the details of the function

Cheers,
Parag

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to