perl -le ' @a = qw/a b c d/; print scalar @a; print $#a; __DATA__ output: 4 3 '