title: Perl generate a file based on a template
body: <p>I am working on a use case that requires me to generate .hpp files based on a template. So something like </p>
  
  <pre><code>#ifdef changethis_hpp
  #define changethis_hpp
  
  #include&lt;fixedheader1&gt;
  ...
  #include&lt;fixedheaderN&gt;
  
  class changethis
  {
  ....
  };
  </code></pre>
  
  <p>needs to be generated based on the requirement of <code>changethis</code> string.
  How can I achieve this in perl? </p>
  
  <p><strong>WHITSF</strong>
  I wrote a fixed template.txt file and and then replaced the text with <code>changethis</code> string and then dumped it as a changethis.hpp. </p>
  
  <p>But is there any other way I can achieve this in perl?</p>