# This should not have the '$dbh->' at the beginning, but the real issue is # $cluster here is a scalar, but foreach my $cluster (@clusters) { # here, they are being treated as arrays (if they were interpolated as written. # $dbh->do ("INSERT INTO $table (start, end) VALUES (cluster[0], cluster[1]);"); # a better approach, if your DBI module supports placeholders: $dbh->do ("INSERT INTO $table (start, end) VALUES (?,?);", @{$cluster}) # or even: $dbh->do ("INSERT INTO $table (start, end) VALUES (?,?);", $cluster->[0], $cluster->[1]) } #### @_=qw; Just another Perl hacker,; ;$_=q=print "@_"= and eval;