I did not answer it because I never disputed whether a single element slice rvalue does the right thing in the first place.
Note (again) that I'm specifically talking about the case with a constant index. Maybe my imagination is indeed limited. I'm honestly tempted to grep all of CPAN to find out whether anyone else has ever found it useful.
But let's accept your argument that it's in the spirit of TMTOWTDI to use it that way as an lvalue and therefor shouldn't be warned against when other similar ways aren't. Let's also accept your agument that it doesn't behave any differently than $array[42] as an rvalue.
I offer that it is a fact that a (even slightly) seasoned Perl programmer will instinctively use the $array[42] notation.
Then is there any argument you can make against warning about it when used as an rvalue (but not lvalue)?
(PS: If you want to talk about too many warnings, you're invited to talk about "used only once"..)
Makeshifts last the longest.
In reply to Re^6: @array[1] is valid??
by Aristotle
in thread @array[1] is valid??
by jdklueber
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |