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.278 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;

# Further use of the Whatever type to grab the last elements of a list.

sub last-two(@list)
{
    @list[* - 2, * - 1];
}

say last-two(<a b c d e>);

=begin pod

=head1 NAME

P02 - Find the last two elements of a list.

=end pod

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