Perl FAQ: How do I determine the size of a file from within a Perl program/script?
Solution - the Perl stat function
Just use the Perl stat function to get the file size. Here is a quick example.
Example - get the file size with Perl stat
To determine size of a file named
foo.txt, just use a little Perl code like this: