in reply to Re^3: RFC: Context tutorial
in thread RFC: Context tutorial

I see. Yes, thanks for clarifying further. An array in scalar context evaluates to the number of items in the array, but the array slice is a list. Now that I think about it, a whole section of "context clash" could be how arrays and hashes behave in list and scalar context, or maybe another section still.

Thanks again for your input!

Replies are listed 'Best First'.
Re^5: RFC: Context tutorial
by ikegami (Patriarch) on Jan 14, 2009 at 01:46 UTC

    An array in scalar context evaluates to the number of items in the array, but the array slice is a list.

    An array slice is not a list, it's an array slice. Each operator (including the list operator, arrays and array slices) decides what it returns in each context. In scalar context, an array slice returns the last element of the slice. It doesn't return a list. It has nothing to do with lists.

      Point taken. Subtle points like this are why I've sought feedback as much as I have. Thanks!