title: How can I get file size in Perl before processing an upload request?
body: <p>I want to get file size I'm doing this:</p>
  
  <pre><code>my $filename=$query-&gt;param("upload_file");
  my $filesize = (-s $filename);
  print "Size: $filesize ";`
  </code></pre>
  
  <p>Yet it is not working. Note that I did not upload the file. I want to check its size before uploading it. So to limit it to max of 1 MB.</p>