title: Clear screen after output in Perl
body: <p>I would like flush the output after executing the script and all the output should not appear in my terminal screen.</p>
  
  <p>Say I have a following example</p>
  
  <pre><code>#!/usr/bin/perl
  print "HAI \n";
  sleep 5;
  </code></pre>
  
  <p>If I execute the above script</p>
  
  <pre><code># ./file
  HAI
  #
  </code></pre>
  
  <p>I would like to have the above output as </p>
  
  <pre><code># ./file
  #
  </code></pre>
  
  <p>HAI Should be displayed for 5 seconds and it should get deleted and no output should be there in the terminal like putty. </p>