title: Is there a less clumsy alternative for copying up to "n" array elements?
body: <blockquote>
    <p>In a world of many <code>@choices</code><br>
    With a <code>$limit</code> to what one can do,<br>
    Life proposes many <code>@options</code><br>
    But at times just one or two.<br>
    In a bid to minimize line noise<br>
    What can <a href="https://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it" rel="nofollow">Tim Toady</a> do?</p>
  </blockquote>
  
  <p>Here are a few ways I've thought of, but they just seem so clumsy. Surely there's a more elegant way to DWIM:</p>
  
  <ul>
  <li><p><em>Verbose one-liner</em></p>
  
  <pre><code>my @choices = @options &lt;= $limit ? @options : @options[0..$limit-1];  # Blech
  </code></pre></li>
  <li><p><em>Slice control</em></p>
  
  <pre><code>my @choices = @options[0..(@options &lt;= $limit ? $#options : $limit - 1)]; # Even worse
  </code></pre></li>
  <li><p><em>Cheesy slice inside a slice</em></p>
  
  <pre><code>my @choices = @options[0..($#options, $limit-1 )[@options &gt; $limit]];  # Crazy eyes
  </code></pre></li>
  <li><p><em>Clearer intent, but over two lines</em></p>
  
  <pre><code>my @choices = @options;
     @choices = @options[0..$limit-1] if $limit &lt; @options;
  </code></pre></li>
  </ul>