while(my $line = ) { $csv->parse($line); my ( $state,$city,$location ) = $csv->fields(); # assumming these are col1,col2,col3 $sth->execute($state,$city,$location) or die "Couldn't execute query: $dbh->errstr"; } #### my $sql =<do($sql);