$ perl -wMstrict -e 'my @foo; @foo[3] = "bar";' Scalar value @foo[3] better written as $foo[3] at -e line 2.