Perl Language List Test 5

I cannot get test 5 to pass in the Language List exercise for Perl. Here is the snippet I am using

sub get_languages (@elements) {
    my @slice = @Languages[@elements];
    return @slice

The tests seem to be using index values “1, 2, 3” instead of “0, 1, 2”. Is this an error in the test, or am I missing something in the way these arrays and slices behave? Or did I miss something even more simple in the instruction? Thanks in advance!

The test behaviour is correct. From the hints and tips for the task:

### Fetch a slice of languages from the @Languages array

* You want a slice of the `@Languages` array.
* Remember that indexes start at 0. Element `1` is index `0`.

The missing step here is translating @elements to the correct indexes.

1 Like

:sweat_smile:

For some reason that hint was not clicking with me at all until you spelled it out. I was able to solve it now. Thank you!