in reply to Testing for definition of references
if( defined $arrayref && defined @$arrayref )
should do it, but
if( defined $arrayref && ref( $arrayref ) eq 'ARRAY' )
looks better to me.
This will test if the array has elements:
if( @$arrayref )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Testing for definition of references
by DBX (Pilgrim) on Jun 26, 2003 at 18:09 UTC | |
by Anonymous Monk on Jun 26, 2003 at 18:15 UTC | |
by fglock (Vicar) on Jun 26, 2003 at 18:18 UTC |