On Thu Oct 21 19:16:41 2004, chip wrote: > The warning about @a[$b] being better written as $a[$b] is triggering > even in list context, which is wrong. > > $ perl -wle 'my ($a) = @ARGV[0]' > Scalar value @ARGV[0] better written as $ARGV[0] at -e line 1. > > It's quite plausible to have a one-element array slice if you're > planning on extending the slice later. Consider a POE sub arg list: > > sub state { > my ($self) = @_[OBJECT]; > # ... > } > > You wouldn't want to make that a $, because if you added another > subscript, the slice would silently fail: > > sub state { > my ($self, $arg) = $_[OBJECT, ARG0]; # OOPS BUG HERE > # ... > } This is one of my pet peeves. It’s the bareword it shouldn’t be warning about. Whether it should warn for @_[0] in list context is slightly more debatable. -- Father Chrysostomos --- via perlbug: queue: perl5 status: open https://rt.perl.org:443/rt3/Ticket/Display.html?id=32083