title: Opening, spliting and sorting into an Arrray in perl
body: <p>I am a beginner programmer, who has been given a weeklong assignment to build a complex program, but is having a difficult time starting off. I have been given a set of data, and the goal is separate it into two separate arrays by the second column, based on whether the letter is M or F. 
  this is the code I have thus far:</p>
  
  <pre><code>#!/usr/local/bin/perl
  
  open (FILE, "ssbn1898.txt");
  $x=&lt;FILE&gt;;
  split/[,]/$x;
  @array1=$y;
  if @array1[2]="M";
  print @array2;
  else;
  print @array3;
  close (FILE);
  </code></pre>
  
  <p>How do I fixed this? Please try and use the simplest terms possible I stared coding last week!
  Thank You </p>