Why doesn't ||= work with arrays?

I use the ||= operator to provide default values for variables, like

$x ||= 1;

I tried to use this syntax with an array but got a syntax error:

@array||= 1..3; 
Can't modify array dereference in logical or assignment (||=) ...

What does it mean and how should I provide arrays with default values?

17
задан planetp 8 December 2010 в 09:37
поделиться