--- 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
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 %h
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, al
--- 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 th
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.
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($va