A quick method to retrieve the size of a file:

my $file = 'file.txt';
my $fileSize = -s $file;
print "$file is $fileSize bytes\n";