title: Indexing directly into returned array in Perl
body: <p>This question has been asked about PHP both <a href="https://stackoverflow.com/questions/172559/most-efficient-way-to-index-a-returned-array">here</a> and <a href="https://stackoverflow.com/questions/2509937/directly-accessing-return-values-without-referencing">here</a>, and I have the same question for Perl. Given a function that returns a list, is there any way (or what is the best way) to immediately index into it without using a temporary variable?</p>
  
  <p>For example:</p>
  
  <pre><code>my $comma_separated = "a,b,c";
  my $a = split (/,/, $comma_separated)[0]; #not valid syntax
  </code></pre>
  
  <p>I see why the syntax in the second line is invalid, so I'm wondering if there's a way to get the same effect without first assigning the return value to a list and indexing from that.</p>