in reply to Is "ref $date eq 'ARRAY'" wrong?
I wrote an object that had a hash ref as part of the object properties (set via the $obj=new CLASS or $obj->Req_Trace(\%mytrace) method)
* In order to ensure that I really had a hash (and not something else, 'case user made a mistake), I used something similar to this...
my $self = shift; my %req = (); if (ref($self->Req_Trace()) eq "HASH") { %req = %{$self->Req_Trace()}; }
Is this a case where using ref within an 'if' statement makes it ok?
Is using @ISA supposed to be used here? If so, how?
What don't I understand?
Could someone explain it to me? (assume that I am not knowledgable about much).
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Is "ref $date eq 'ARRAY'" wrong?
by runrig (Abbot) on Dec 20, 2003 at 16:53 UTC | |
by Sandy (Curate) on Dec 20, 2003 at 17:13 UTC |