while (my $pointer = $sth->fetchrow_hashref){ $CT5 = $pointer->{'CT5'}; $STR = $pointer->{'STR'}; $FNAME = $pointer->{'FNAME'}; $LNAME = $pointer->{'LNAME'}; $EMAIL=$EMFNAME.$EMLNAME."\@tstcompany.com"; $EMAIL=~s/\s+//; $EMAIL=~s/\s+//; $EMAIL = lc($EMAIL); $sql="INSERT INTO email (f_name, l_name, code, ext, email) VALUES ('$FNAME', '$LNAME', '$STR', '$CT5', '$EMAIL')"; #$sth = $dbh->prepare($sql); #$sth->execute() || die $sth->errstr; #$sth->finish; print "
EXT# = $CT5 / Code = $STR / First Name = $FNAME / Last Name = $LNAME / E-Mail = $EMAIL "; } $sth = $dbh->prepare($sql); $sth->execute() || die $sth->errstr; $sth->finish;