title: How can I print the first to the fifth from last array elements in Perl?
body: <p>I'm running the following code and I'm attempting to print the first element in the <code>@rainbow</code> array through the fifth-from-last element in the <code>@rainbow</code> array. This code works for any positive indices within the bounds of the array, but not for negative ones:</p>
  
  <pre><code>@rainbow = ("a".."z");
  @slice = @rainbow[1..-5];
  print "@slice\n";
  </code></pre>