I guess it makes sense, but I have to say that this hardly seems like DWIM behaviour...
Oh well, can't win em all can you?
UPDATE:
Ive now had a look at the section on the comma operator, but frankly I can't tell which part of the docs suggest that this behaviour is correct.
- Binary ``,'' is the comma operator. In scalar context it evaluates its left argument, throws that value away, then evaluates its right argument and returns that value. This is just like C's comma operator.
- In list context, it's just the list argument separator, and inserts both its arguments into the list.
- The => digraph is mostly just a synonym for the comma operator. It's useful for documenting arguments that come in pairs. As of release 5.001, it also forces any word to the left of it to be interpreted as a string.
This seems to suggest, given that inside of an annon array the comma's are in list context, that it should insert both of its arguments (empty agreed, so it should be undef no?) into the list. So I am still confused about this behaviour, and unconvinced that its not a bug.
I welcome further info.
Yves / DeMerphq
--
When to use Prototypes?
In reply to Re: Re: Bug with lists?
by demerphq
in thread Bug with lists?
by demerphq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |