in reply to A new FALSEness

This line returns a false value:

return if $target < 0 || @$treasures == 0;

? [] = empty list?

As you say later, it's a reference to an empty (anonymous) array, not an empty list.

Replies are listed 'Best First'.
Re^2: A new FALSEness
by AnomalousMonk (Archbishop) on Mar 03, 2009 at 22:31 UTC
    More particularly, the statement
        return if $target < 0 || @$treasures == 0;
    returns undef in scalar context and the empty list  () in list context.

    Both of these return values evaluate as false, so this statement returns a false value regardless of the context in which the function was called.

      But "false" is a scalar concept. Any boolean test is scalar context.