On Aug 3, 8:32am, Simon Cozens wrote:
> This is the rationale? Sounds a bit of assault on Perl's flexibility for this
> little gain. As Randal said, there's no teaching advantage in it.
Strictly speaking, the rationale was in this part:
Although it can be argued that this is logical and
consistent (it is), it can also cause confusion because the prefix is
used to denote what is returned, rather than indicating the variable
from which the value(s) are retrieved. For example:
$foo[2]; # third element of @foo, no relation to $foo
@foo{'bar', 'baz'}; # slice of %foo, no relation to @foo
This is paraphrased from an extract from Camel II (p 37):
"This means that $foo and @foo are two different variables. It also
means that $foo[1] is an element of @foo not a part of $foo. This
may seem a bit weird, but that's okay because it is weird."
I'm not assaulting Perl's flexibility or syntax. Nor am I suggesting
that you, Randal or anyone else is particularly confused by this. I'm
simply making a Request For Comments on a suggestion on how some of
Perl's syntax might be made less "weird" (their choice of words, not mine).
We may not decide to make it less weird, which is fine by me, but if we
do, then this is one way in which we might do so. I *personally* can see
the teaching advantage, but no-one is obliged to agree with me. :-)
Please also note that at no point did I suggest making exceptions for
$ARGV/@ARGV, etc. I just flagged them as issues that needed addressing.
A
--
Andy Wardley <[EMAIL PROTECTED]> Signature regenerating. Please remain seated.
<[EMAIL PROTECTED]> For a good time: http://www.kfs.org/~abw/