title: Take input from a file and have each value separated by spaces be put into a variable
body: <p>First time poster and my first time trying to script in Perl so be gentle with me.</p>
  
  <p>What I need to do is read a log file that contains ip's and port numbers. The contents of the file are:</p>
  
  <pre><code>6056 255.255.255.255 6056 255.255.255.255 80
  16056 255.255.255.255 16056 255.255.255.255 80
  7056 255.255.255.255 7056 255.255.255.255 80
  17056 255.255.255.255 17056 255.255.255.255 80
  </code></pre>
  
  <p>The file contains more entries like this.</p>
  
  <p>The first value of every line needs to be extracted and added to a variable <code>$LocalPort</code>, the second value of every line assigned to <code>$LicenseServer</code>, third value <code>$RemotePort</code>, fourth value <code>$ShServer</code>, fifth value <code>$ShServerport</code>.</p>
  
  <p>At the end of every loop values are will be inserted into <code>$command</code> variable and written to a file that can be run as a script to establish a vsh connection. I can read in the file just fine but I am unsure of how to extract each value and assign it to the appropriate value each time it goes threw the loop. I currently have this:</p>
  
  <pre><code>open (LOGFILE, $LogPath) || "Unable to open the log file or file does not exist $!";
  while (@line =  &lt;LOGFILE&gt;)
  {
      $LocalPort=$line[0]; 
      $LicenseServer=$line[1];
      $RemotePort=$line[2];
      $ShServer=$line[3];
      $ShServerpor=$line[4];
  
      print "$LocalPort\n";
      print "$LicenseServer\n"
      print "$RemotePort\n";
      print "ShServer\n";
      print "ShServerPort\n";
  }
  </code></pre>
  
  <p>So far all I can get it to do is spit back the exact file as it reads it in. This is really my first attempt at scripting and I have no training other then what I can gather from lord Google. Any help is much appreciated.</p>