in reply to Re^5: Why? (each...)
in thread Why? (each...)

where parens often indicate to the reader that he is looking at a list.

You say foreach (), I say while () and if ().

You say my ($x,$y,$z) = @_;, I say ($x+$y+$z)*$n.

The parens in foreach(),

The parens of foreach not even part of the expression, and the list is still created when you omit them.

say foreach "a", "b";

Or to put it differently, they indicate it's not an array and not a hash (and not a scalar).

Really?

$s = ($x); %h = ($x); %h = ([]);

Your model has too many holes to count :(

Simple model: A list is created whenever something is evaluated in list context.

Replies are listed 'Best First'.
Re^7: Why? (each...)
by LanX (Saint) on May 13, 2011 at 00:06 UTC
    >The parens of foreach not even part of the expression, and the list is still created when you omit them.

    say foreach "a", "b";

    Well, you know that postfix-commands follow different syntax rules!

    Cheers Rolf

      My point is that the idea that parens create a list is flawed. How is that relevant?
        "Indicate" is not the same as "create" and I never said "create"!! And we were talking about in certain situations/context yet your examples are all over the map. We're clearly not on the same page.

        Elda Taluta; Sarks Sark; Ark Arks