title: perl script: using Sleep() or Pause () to wait new updated data
body: <p>is there any method to write a program to wait the need update text file using <code>sleep()</code> function or <code>pause()</code> function? The program is hanging on execution stage and once the particular file is updated and the program will continue its work.:</p>
  
  <pre><code>#!/usr/bin/perl
  
  open (FILE, "/home/terrance/Desktop/perl/record.txt") || die "$!";
  
  while(my $line = &lt;FILE&gt;)
  {
          chomp($line);
          my $offset =0;
          seek(FILE, $offset, 1);
          print "$line\n";
          sleep(0.1);
  }
  </code></pre>