title: Is there any way to check whether a file is an empty file using PERL program?
body: <p>I am looking a small script which will tell me whether a file is an empty file or not , but i am unable to display this.</p>
  
  <p>I have used the below code :</p>
  
  <pre><code>opendir DIR,$directory ;
  while (my $dir =readdir DIR) {
      if (-s "$dir") {
      print "This is an empty file";
      }
  }
  </code></pre>
  
  <p>Here i am unable to print "This is an empty file" and my code does not went inside the if loop. Can anyone tell me what is the wrong in the above code</p>