in reply to Re^3: Empty List miracle(1)
in thread Empty List miracle(1)

I don't think there is a good way to explain the default behavior of a list in scalar context, because there are too many ways to create lists in Perl and too many ways to enforce scalar context.

What does a list do in scalar context provided by scalar assignment?

What does a list do in scalar context provided by the scalar operator?

What does a list do in scalar context provided by any other infix operator?

What does a list do in scalar context provided by the prototype of an operator?

I might be missing some (hash key?).

Replies are listed 'Best First'.
Re^5: Empty List miracle(1)
by Anonymous Monk on Apr 30, 2010 at 09:39 UTC
    "List" Is a Four-Letter Word Note: there is no such thing as a list in scalar context. When this appears to be the case, the comma operator is put to work.