in reply to Finding local vs Global Error

Based on those error messages, I'd say at least some of your errors are on or near lines 77, 109, and 110. Another error occurred somewhere there, too, but that missing curly/square bracket error is a bit loose on its guess.

Lines 75-77 of what was posted:

$dbh = ("DBI:mysql:host=localhost; database=blah", "blah", "blah", {PrintError => 0, RaiseError=>1});
I think you're missing the "DBI->connect" part before the opening parenthesis. As for lines 109/110, on line 112, you use a variable $index which was not local'd or my'd anywhere prior. I'm not sure whether this is supposed to be a new variable or what scope you want it - probably right before the while loop for reading the file.

Finally, your missing close-brace is that your process_files sub doesn't close properly - not as many }'s as {'s. I'm guessing that if you add a brace right before the line that says "sub usage", that would go away, too.

Given the line numbers I'm getting here vs your error messages, I'd wager that the code you posted is not precisely the code you tested. That's something I'd like to highly discourage you from doing - it's much harder to debug a virtual problem than a concrete one. And it's even harder to debug a virtual problem that's masquerading as a concrete one via some misleading code.