in reply to Re^4: wantarray - surprise behaviour
in thread wantarray - surprise behaviour
I've seen this said before, but
P:\test>perl -MO=Deparse -e"@a = 1,2,3,4,5; print @a" @a = 1, '???', '???', '???', '???'; print @a; -e syntax OK P:\test>perl -e"@a = 1,2,3,4,5; print @a" 1 P:\test>perl -MO=Deparse -e"@a = (1,2,3,4,5); print @a" @a = (1, 2, 3, 4, 5); print @a; -e syntax OK P:\test>perl -e"@a = (1,2,3,4,5); print @a" 12345
Empirically, that suggests that the parens are, at least in some cases, required to build a list.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: wantarray - surprise behaviour
by Anonymous Monk on Sep 01, 2004 at 14:51 UTC | |
by BrowserUk (Patriarch) on Sep 01, 2004 at 16:23 UTC |