In scalar context, (empty_list)[0] is just the indexing operator.
It's still a slice. For example, you can do
$x = ( f() )[2,3,4];
The rest is accurate, though. In scalar context, the slice operator will always return exactly one element. It will never return an empty list that magically becomes a scalar.
In reply to Re^3: Empty List miracle (2)
by ikegami
in thread Empty List miracle (2)
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |