in reply to Re^6: Does @{ } copy arrays?
in thread Does @{ } copy arrays?
I suppose there are cases where it's not immediately apparent to the parser if a given occurrence is an lvalue or rvalue?
Perl is very much aware of which expressions should return something "M"odifiable.
$ perl -MO=Concise,-exec -e' $x=$#a ' 2>&1 | grep av2arylen 5 <1> av2arylen sK/1 $ perl -MO=Concise,-exec -e' $#a=$x ' 2>&1 | grep av2arylen 6 <1> av2arylen sKRM*/1 $ perl -MO=Concise,-exec -e' foo($#a) ' 2>&1 | grep av2arylen 6 <1> av2arylen sKM/1 $ perl -MO=Concise,-exec -e' \$#a ' 2>&1 | grep av2arylen 5 <1> av2arylen sKRM/1 $ perl -MO=Concise,-exec -e' 1 for $#a ' 2>&1 | grep av2arylen 7 <1> av2arylen sKM/1 $ perl -MO=Concise,-exec -e' 1 for 0..$#a ' 2>&1 | grep av2arylen 8 <1> av2arylen sK/1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Does @{ } copy arrays?
by QM (Parson) on Oct 29, 2009 at 16:36 UTC | |
by ikegami (Patriarch) on Oct 29, 2009 at 16:47 UTC | |
by QM (Parson) on Oct 30, 2009 at 14:22 UTC | |
by ikegami (Patriarch) on Oct 30, 2009 at 14:55 UTC |