in reply to Re: array assignment with list operator , no parenthesis
in thread array assignment with list operator , no parenthesis
I'm not sure where you are going, but it seems the conclusion would be that
my @one = 7,2,3;
is
my @one = (7,2,3);
because
(my @one = 7),2,3;
would be annoying.
The very post to which you replied shows this is untrue.
my @one = 7,2,3;
is the same as
(my @one = 7),2,3;
There is more than one operator represented by the comma. Your examples and therefore your conclusion are irrelevant to the OP's problem since you're not using the same operator. The OP's problem is that he used the comma operator where he wanted to use the list seperator, not one of precedence.
Just like join forced a list in your example, the OP can force a list by adding parens around the would-be list. The parens do not change the precendence in this case. They change the parsing context, causing the comma to be parsed as a different operator.
Update: Changed wording.
Update: s/context/parsing context/, in response to shmem's reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: array assignment with list operator , no parenthesis
by shmem (Chancellor) on May 15, 2007 at 10:08 UTC | |
by ikegami (Patriarch) on May 15, 2007 at 17:29 UTC |