in reply to Read/Create files
i is not numeric.
$i is.
Welcome to Perl. :-)
perl -E'@n=7..9;$x=$n[i];say$x' 7 [download]
In this case, i is kinda evaluated as numeric :)
perl -MO=Deparse -E'@n=7..9;$x=$n[i];say$x' @n = 7..9; $x = $n[0]; say $x; -e syntax OK [download]