Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 7d9c16311e
Fetching contributors…

Cannot retrieve contributors at this time

file 21 lines (13 sloc) 0.277 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/usr/bin/env perl6
use v6;

sub insert-at($elem, @list is copy, $place)
{
    @list.splice($place - 1, 0, $elem);

    @list
}

say insert-at('alfa', <a b c d>, 2);

=begin pod

=head1 NAME

P21 - Insert an element at a given position into a list.

=end pod

# vim: ft=perl6
Something went wrong with that request. Please try again.