The || operator forces scalar context on the left operand, so it returns the number of elements in the referenced array. If the array is empty, the number is 0, so || works and returns undef, i.e. empty array.@jazz = ( @{ $_[0] } || () );
In reply to Re: Dereference Empty(!) Array
by choroba
in thread Dereference Empty(!) Array
by lukestyle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |