title: what's the best way to get multiple values from a perl array?
body: <p>For example,</p>
  
  <p>First, I get the dataRecord into an array like this,</p>
  
  <pre><code>  my @dataRecord = split(/\n/);
  </code></pre>
  
  <p>Next, I filter on the array data record to get the test lines like this,</p>
  
  <pre><code>  @dataRecord = grep(/test_names/,@dataRecord);
  </code></pre>
  
  <p>Next, I need to get the test names from the test line like this,</p>
  
  <pre><code>   my ($test1_name,$test2_name,$test3_name)  = getTestName(@dataRecord);
  
     sub getTestName
     {
         my $str = shift @_;
         # testing the str for data and 
         print str,"\n"; # This test point works in that I see the whole test line.
         $str =~ m{/^test1 (.*), test2 (.*), test3 (.)/};
         print $1, "\n"; # This test point does not work. 
         return ($1,$2,$3);
      }
  </code></pre>
  
  <p>Is there a better way for me to acommplish this task?</p>