in reply to DBI SUM function
You can simplify that using the $dbh->selectrow_array($statement); method.
my ($val) = $dbh->selectrow_array("SELECT sum(file_size) FROM dir_info +"); [download]