At this point I guess I would humbly state my opinion that in this instance there perl interpreter has gone beyond TIMTOWTDI to "Thats just plain wrong" (just my opinion).
In my mind, order-of-operation precedence is implicitly bounded by the end-of-statement semi-colon ';'. If a function (like print) takes an argument of LIST, it should greedily operate on all list elements up to the end of the statement indicated by the ';'.
So, "print (LIST),LIST;" should just do "print (LIST,LIST);". I understand that using parens as function argument delimiters is optional, and that inconsistent use of parens with functions leads to ambiguous dilemmas, but if someone really wanted to execute the second list in "function (LIST),LIST;", then they should have not used comma ',' as a statement separator, they should have use a semi-colon as "function (LIST);LIST;".
In my mind, the semi-colon is a statement separator, and the comma is a LIST argument separator. When perl interprets "function (LIST),LIST;" as "function (LIST);LIST;", it is implicitly treating (and converting) the comma into a statement separator.
I really like perl, but in this one instance I think the behaviour is wrong. I am sure that Larry and some other developers have had some philosophical discussions about this example, and if anyone can dig them up I would be happy to read them.
Thanks,
In reply to Re^2: print list, comma not working?
by fzellinger
in thread print list, comma not working?
by fzellinger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |