Dan Book via RT wrote: > On Thu, Apr 19, 2018 at 6:09 PM, L A Walsh <perl-diddler@tlinx.org> wrote: > ... > > >> The manpage shows: >> Functions for real @ARRAYs >> "each", "keys", "pop", "push", "shift", "splice", "unshift", >> "values" >> >> Functions for real %HASHes >> "delete", "each", "exists", "keys", "values" >> >> > > each, keys, and values work on both arrays and hashes. As does exists and > delete, technically. > > -Dan > > Yes...for dereferencing to work in this case, the scalar would have to hold either an ARRAY or HASH reference. It really makes no sense to try to use "each", "keys" nor "values" on a a scalar that has value 'undef'. It would make no sense and would (should) generate an error as it does now. Only functions that require an ARRAY *XOR* HASH could take undef. Off hand, I can't think of a function that would autovivify a HASH. Does that clarify the intent of my proposal? It may be the case that my proposal is not the same as what was implemented before (I never used it), but only a subset that is deterministic.Thread Previous | Thread Next