in reply to Check for variable without leaving a trace
The documentation for defined says
Use of defined on aggregates (hashes and arrays) is deprecated. 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:1. if (@an_array) { print "has array elements\n" } 2. if (%a_hash) { print "has hash members\n" }
|
|---|