title: perl printing to stdout instead of printing to file
body: <p>So I'm bangin my head against the wall on this one, and honestly think I'm missing something simple.  I'm also thinking that my issue is either something wrong with the herdoc or something wrong with how I'm using STDIN.  </p>
  
  <p>Anywho, when I run the following script on the command line(yes running as root), instead of printing to the file, it just prints to STDOUT, which is confusing the hell out of me.</p>
  
  <pre><code>sub do_stuff {
      my $resp = &lt;STDIN&gt;;
  
      my $service_file = &lt;&lt;END_FILE;
  [Unit]
  Description = tc hack for perist across reboot
  After = syslog.target network.target nss-lookup.target
  
  [Service]
  Type = simple
  ExecStart = /etc/tc/tcconfig.sh
  ExecReload = /bin/kill -HUP \${MAINPID}
  ExecStop = /bin/kill -INT \${MAINPID}
  TimeoutSec = 30
  Restart = on-failure
  LimitNOFILE = 32768
  
  [Install]
  WantedBy = multi-user.target
  
  END_FILE
      my $service_path = '/etc/systemd/system/multi-user.target.wants/tc.service';
  
      open(my $sfile, "&gt;", $service_path)
        || die "can't open file for write ($service_path) $!";
      print $service_file;
      close $sfile;
  
  }
  </code></pre>
  
  <p>And the output of this to the command line is:</p>
  
  <pre><code>[Unit]
  Description = tc hack for perist across reboot
  After = syslog.target network.target nss-lookup.target
  
  [Service]
  Type = simple
  ExecStart = /etc/tc/tcconfig.sh
  ExecReload = /bin/kill -HUP ${MAINPID}
  ExecStop = /bin/kill -INT ${MAINPID}
  TimeoutSec = 30
  Restart = on-failure
  LimitNOFILE = 32768
  
  [Install]
  WantedBy = multi-user.target
  </code></pre>
  
  <p>The output is being printed to the command line rather than the file.  No idea why.  Any help much appreciated!</p>
  
  <p>Cheers</p>