bwelch has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,
In a function that reads several million rows from a database, I'm finding it is taking a very long time to complete. I recently added use warnings; to the script and am now seeing this message many times in the log:

"Use of uninitialized value in concatenation (.) or string at line xxx"

I'm not seeing what is not initialized here. Do you?

Since this is taking a long time to complete, could you recommend any optimizations? thanks, Bryan

use strict; use warnings; # Added this line in last run sub build4PartFastaFile { &addDateStamp; my ( $fileToMake, $dbCommand ) = @_; open( FILE, ">$fileToMake" ) or die print "Can't open fileToMake: $! +"; my $sth2 = $dbh->prepare( $dbCommand ) or die print LOG "Can't prepa +re: $! OR $DBI::errstr"; $sth2->execute or die print LOG "Can't execute: $! OR $DBI::errstr"; while ( ( my $giName, my $gssName, my $definition, my $sequence ) = +$sth2->fetchrow_array ) { $sequence = uc( $sequence ); $sequence =~ s/(\S{1,80})/$1\n/g; print FILE ">$giName $gssName $definition\n$sequence"; } close( FILE ); }