--- Jeff Pang [EMAIL PROTECTED] wrote:
If I'm not mistaken, all Perl objects are references to a hash.
Not correct at all.
Perl objects can be anything that's the blessed references.
This is correct. It's another reason why you don't want to care about
what data structure is being
Anish Kumar K schrieb:
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
Hi,
try this: ref($var);
Anish Kumar K [EMAIL PROTECTED]
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...
The function ref does what you want.
HTH,
--- Anish Kumar K [EMAIL PROTECTED] 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...
If you need to know the
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,
If I'm not mistaken, all Perl objects are references to a hash.
Not correct at all.
Perl objects can be anything that's the blessed references.
You can say any the below:
sub new {
my $class = shift;
my $var = 'foo';
bless \$var,$class;
}
sub new {
my $class = shift;
my