X
xueweizhong
Hi perl guys,
Let's discuss 2 expressions here:
1.
2.
My question is:
In `( stat (".") ) [0]', the `()' don't decide the list context, but
`()[0]' decides it a list context. Following this way, in `stat(".")
[0]', why [0] doesn't decide that the left side `stat(".")' is
evaluated in list context?
BTW, the `[]' is not counted as an operator in perlop(in C, it's an
binary operator), it's counted as an term delimiter, so we can
redeclare our questions as:
How to decide the list context inside term?
Best regards
Todd
Let's discuss 2 expressions here:
1.
syntax error at -e line 1, near ") ["perl -e 'stat (".") [0]'
2.
The 2nd one compiles right.perl -e '( stat (".") ) [0]'
My question is:
In `( stat (".") ) [0]', the `()' don't decide the list context, but
`()[0]' decides it a list context. Following this way, in `stat(".")
[0]', why [0] doesn't decide that the left side `stat(".")' is
evaluated in list context?
BTW, the `[]' is not counted as an operator in perlop(in C, it's an
binary operator), it's counted as an term delimiter, so we can
redeclare our questions as:
How to decide the list context inside term?
Best regards
Todd