title: To split at whitespace in Perl
body: <p>I have a data of type - </p>
  
  <pre><code>500 3.6673656 
  ----------
  1000 3.2707536
  ----------
  1500 3.2356145
  ----------
  2000 3.0495141
  ----------
  2500 3.016674
  </code></pre>
  
  <p>i.e. time and the distance. 
  I need to split time in one array and distance in an other. 
  by using <code>my @line = split( /\s+/, $_);</code> i could store the distance in one array, but can't store time. 
  Is there any other way to separately store each of them in different array?</p>
  
  <p>input is taken from a file and contents are stored in <code>@array</code>.</p>
  
  <p>my script:</p>
  
  <pre><code>    foreach $_ (@array){ 
      if($_ =~ /[@]/) {# do nothing, it's a comment or formatting line} 
      else  {my @line = split( /\s+/, $_);
      print "@line\n";}
  }
  </code></pre>