title: How can I also get an element's index when I grep through an array?
body: <p>Let's say I have this list:</p>
  
  <pre><code>my @list = qw(one two three four five);
  </code></pre>
  
  <p>and I want to grab all the elements containing <code>o</code>. I'd have this:</p>
  
  <pre><code>my @containing_o = grep { /o/ } @list;
  </code></pre>
  
  <p>But what would I have to do to also receive an index, or to be able to access the index in <code>grep</code>'s body?</p>