, use diagnostics;
$ perl -Mdiagnostics -le " splice @ARGV, -1 ,0 "
Modification of non-creatable array value attempted, subscript -1 at -e line 1 (
(F) You tried to make an array value spring into existence, and the
subscript was probably negative, even counting from end of the array
backwards.
Uncaught exception from user code:
Modification of non-creatable array value attempted, subscript -1 at -e line 1.
at -e line 1.
$ perl -Mdiagnostics -le " splice @ARGV, -1 ,0 " argv now not empty
, , , 0 ( )
$ perl -le " print for splice @ARGV, 0, $#ARGV-1 " a b c
a
. $# ARGV - , $# ARGV -1,
$ perl -le " print for splice @ARGV, 0, $#ARGV " a b c
a
b
, @ARGV,
$ perl -le " print for splice @ARGV, 0, @ARGV-1 " a b c
a
b
? , .
$ perl -le " print for splice @ARGV, 0, 10 "