title: File::Slurp faster to write a file to perl
body: <p>I have a perl script where I am writing out a very large log file. Currently I write out my file in the 'traditional' Perl way of doing it:</p>
  
  <pre><code>open FILE, "&gt;", 'log.txt';
  print FILE $line;
  .....
  close FILE;
  </code></pre>
  
  <p>I've heard a lot of good things about <a href="https://metacpan.org/module/File::Slurp" rel="nofollow">File::Slurp</a> when reading in files, and how it can vastly improve runtimes. My question is, would using File::Slurp make writing out my log file any faster? I ask because writing out a file in perl seems pretty simple as it is, I don't know how File::Slurp could really optimize it anymore.</p>