- or download this
$ perl -le 'print prototype("CORE::splice")//"undef"'
\@;$$@
- or download this
sub mysplice (\@;$$@) {
my ($arr,$off,$len,@list) = @_;
splice @$arr, $off//0, $len // @$arr - ($off//0), @list;
}
- or download this
use warnings;
use strict;
...
is( j(@a), j(1,3,2), 'swap last two elements (with &)');
done_testing;