http://www.perlmonks.org?node_id=1044103


in reply to Conditional array initialisation?

I just started reading the Perl Cookbook, and came across a similar example (chapter1 Strings, p12), only with ||= as //= was not implemented at the time of publication. It says don't extend the use of the ||= assignment operator to arrays and hashes, because the operators put the left operand into scalar context. Instead use the ternary operator, like you did later.