in reply to Re^2: Empty List miracle (2)
in thread Empty List miracle (2)
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.
|
|---|