in reply to map() and grep() suppress "Can't use an undefined value as an ARRAY reference at ..." errors

Haven't done a ton of research yet, but think the answer is the same as in Array dereference in foreach(): map probably provides lvalue context to the list it is iterating over (because it allows modification of the original items of the list via $_), and autovivification happens in lvalue context. Further somewhat related reading:

Update: stevieb beat me to it :-)

  • Comment on Re: map() and grep() suppress "Can't use an undefined value as an ARRAY reference at ..." errors
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: map() and grep() suppress "Can't use an undefined value as an ARRAY reference at ..." errors
by stevieb (Canon) on Mar 15, 2018 at 21:12 UTC
    stevieb beat me to it :-)

    By only mere seconds bud ;)