title: Output to a file, using input from another file
body: <p>I'm trying to output to a file, using input from another file. No keyboard input.</p>
  
  <p>I know I'm on the right track, my syntax is just a little off.</p>
  
  <p>Basically, I'm taking records from the file "boot.log", using pattern matching selecting certain records and outputting them to a file named "bootlog.out". I haven't gotten to the pattern matching part yet. Here's what I have...</p>
  
  <pre><code>open (BOOTLOG, "boot.log") || die "Can't open file named boot.log: $!";
  
  while ($_ = &lt;BOOTLOG&gt;)
  {
  print $_;
  }
  
  open (LOGOUT, "&gt;bootlog.out") || die "Can't create file named bootlog.out: $!\n";
  
  close (LOGOUT) || die "Can't close file named bootlog.out: $!\n";
  
  close (BOOTLOG) || die "Can't close the file named boot.log: $!";
  </code></pre>
  
  <p>How do I print the contents of boot.log to bootlog.out?</p>
  
  <p>EDIT1</p>
  
  <p>This seems to take the input and output it to the second file. Is the syntax correct?</p>
  
  <pre><code>open (BOOTLOG, "boot.log") || die "Can't open file named boot.log: $!";
  
  open (LOGOUT, "&gt;bootlog.txt") || die "Can't create file named bootlog.out: $!\n";
  
  while ($_ = &lt;BOOTLOG&gt;)
  {
  print $_;
  print LOGOUT $_;
  }
  
  close (LOGOUT) || die "Can't close file named bootlog.txt: $!\n";
  
  close (BOOTLOG) || die "Can't close the file named boot.log: $!";
  </code></pre>