Help for this page

Select Code to Download


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