open INFILE, ') { my $dbh = DBI->connect("dbi:mysql:database=maindb;host=localhost"); my $sth = $dbh->prepare("SELECT * FROM $table WHERE uid=$user"); $sth->execute; print join(',', $sth->fetchrow_array); print "\n"; }