in reply to Hash Value Part 2

Couple of things:

1. You test the value of !$data[0] before assigning anything to it. So you end up testing whether or not you need to insert a $comp_id based on the result of the previous $comp_id.

2. Have you SQL-sanatized your comp_names? you need to replace any single quotes in a company name with two single quotes, otherwise the SQL statement will yield a syntax error. Try something along the lines of

map {$hash{$_} =~ s/'/''/g;} (keys %hash);
Also, it would help if you said what kind of errors you were getting...