One of mine, in the early days of learning about DBI...
open INFILE, '<source.txt';
while (<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";
}
Note the complete lack of error handling, no use of prototypes, and the assumption that only one row would be returned. I also particularly enjoy the two separate print statements. And, I printed to STDOUT (without setting $|) even though I wanted to write to a file.