Anish Kumar K wrote:
Hi
In java we have instance operator to tell the type of Object.

Similarly in perl say I am passing a reference object to a function,

Is it possible to detect in the function whether the object is HASH or ARRAY...

Thanks
Anish

Hello Anish...

   If I'm not mistaken, all Perl objects are references to a hash.

if you instantiate an object in Perl (either from your own package definition or an external Perl module)...

my $objectVar = SomePackage->new();

then you...

print ("$objectVar");

you will get something like....

SomePackage::HASH:0x12a78b39


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to