Thanks for the advice. Per your suggestion the code was changed as below. The result was 5856 when it should be 1760(verified).
#! Check Folder Size
use File::Find;
my $total_size = 0;
find(sub { $total_size += -s }, $upload_dir );
if ($total_size > $maxfoldersize) {
print"You have exceded your limit of $maxfoldersize KB for the directory
$email_address \n";
}
#! End of Folder Check