foreach(@invoices_sets) { my @retvals = process_values($_); $file_content .= $retvals[0]; $invoice += $retvals[1]; }