in reply to Re: How best to tell when my hash is "full" (all values defined)?
in thread How best to tell when my hash is "full" (all values defined)?
grep !defined, values %stats || last;
as a quick and simple escape clause?
For some reason I like the idea of predeclaring what data I want (by mnemonic), and "filling" an empty data structure, as opposed to creating the key-value pairs on the fly. It's just mental I guess, though I suppose it may increase readability somewhat. Also, is there a memory or performance penalty if you don't predeclare the numer of elements in a hash? Returning the scalar of the hash gives me 4/8 with the predeclared version; I suppose I will try it the other way and report back.
Thanks again to everyone,
T.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How best to tell when my hash is "full" (all values defined)?
by OfficeLinebacker (Chaplain) on Dec 18, 2006 at 15:26 UTC | |
|
Re^3: How best to tell when my hash is "full" (all values defined)?
by OfficeLinebacker (Chaplain) on Dec 18, 2006 at 15:41 UTC |