in reply to Re^5: wantarray - surprise behaviour
in thread wantarray - surprise behaviour

But they don't create lists. They are 'required' just as they are in some cases required to call a function correctly. That doesn't mean parens call functions. In the case you describe, parentheses are used for precedence:
perl -MO=Deparse,-p -e"@a = 1,2,3,4,5; print @a" ((@a = 1), '???', '???', '???', '???'); print(@a); -e syntax OK
A list is still created - it's just not the list you want.

Replies are listed 'Best First'.
Re^7: wantarray - surprise behaviour
by BrowserUk (Patriarch) on Sep 01, 2004 at 16:23 UTC

    Which goes to demonstrate that saying that , and => builds lists is not enough.

    Just as parens are often required to clarify the programmers intent, so mentioning parens, and precedence is required to clarify the language's definition of a list.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon