in reply to Re: How to have a subroutine return an undefined hash
in thread How to have a subroutine return an undefined hash
Quoth perldoc -f defined:
Use of "defined" on aggregates (hashes and arrays) is depre- cated. It used to report whether memory for that aggregate has ever been allocated. This behavior may disappear in future versions of Perl. You should instead use a simple test for size: if (@an_array) { print "has array elements\n" } if (%a_hash) { print "has hash members\n" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to have a subroutine return an undefined hash
by samizdat (Vicar) on Apr 26, 2005 at 12:59 UTC |