in reply to Is "ref $date eq 'ARRAY'" wrong?
it is safe enough, I think, to treat the reference as an array if it "implements" an array (eg. if it's something like Foo::Bar=ARRAY(0xdeadbeef)) the same way it is safe enough to call $object->{property} when $object is something like Foo::Bar=HASH(0xdeadbeef).$date = (ref $date =~ /ARRAY/) ? $date : [ split(/\D+/, $date) ];
don't know, however (I don't have time to check now), if this works for tied arrays.
someone correct me please if I'm wrong :-)
King of Laziness, Wizard of Impatience, Lord of Hubris
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Is "ref $date eq 'ARRAY'" wrong?
by gmpassos (Priest) on Dec 20, 2003 at 03:24 UTC |