open INPUT_FILE, @row[$cell_column] or die "Can't open @row[$cell_column]: $!\n"; while ( $line = ) { chomp $line; if ($line =~ /^#/ || $line =~ /^\s*$/) { next; } $line =~ s/^[^=]*\=//; @users = split /,/, $line; } close INPUT_FILE; $placeholders = join ( ',', ('?') x @users ); my $SQLLock=qq{ select user,name from teams where user in ( $placeholders ) }; my $sthL = $dbh->prepare($SQLLock); $sthL->execute(@users); while ( my @row = $sthL->fetchrow_array() ) { print ">@row<\n"; for($cell_column=0; $cell_column<=$#row; $cell_column++){ $worksheet->write_string($i, $cell_column, @row[$cell_column],$format1); } $worksheet->set_row($i, undef, undef, 0, 0, 1); $i++; } $sthL->finish;