if (/Distribution--/) { # Check to see if the Order/Title combo has been seen before if ($seen{$$hashReference{orderID},$$hashReference{title}}) { # Visual prompt for debugging print "Bollox\n"; next RECORD; } # End if else { # Add the "unseen" Order/Title combo to the hash $seen{$$hashReference{orderID},$$hashReference{title}}++; #Write the Order "header" info to the spreadsheet $worksheet->write($row,0,$$hashReference{fiscalCycle}); $worksheet->write($row,1,$$hashReference{vendorID}); $worksheet->write($row,2,$$hashReference{orderID}); $worksheet->write($row,3,$$hashReference{requisitionNum}); $worksheet->write($row,4,$$hashReference{title}); $worksheet->write($row,5,$$hashReference{'ISBN/ISSN'}); $worksheet->write($row,6,$$hashReference{copies});