in reply to Truthfulness of references
To my initial surprise, the code above printed "We have a hash reference.", even though the hash I've referenced is empty ( ie: no keys and no values ).
No matter how many keys it hash, it's still a hash. ref(\%hash) returns HASH, which is a true value. if (%$hash_ref) will tell you if the referenced hash is empty or not.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Truthfulness of references
by njcodewarrior (Pilgrim) on Mar 13, 2007 at 11:15 UTC | |
by ikegami (Patriarch) on Mar 14, 2007 at 07:12 UTC |