$dbh = DBI->connect( 'Blah', 'Blah', 'Blah', 'Blah' ); # $dbh->LongReadLen( 65535 ); # since you're not fetching any data, this line doesn't do anything useful $stmt = $dbh->prepare( "UPDATE Images SET Name = ?" ); for(@JpgList){ $stmt->execute( $_ ); rename("$_","Processed/$_"); } $stmt->finish; $dbh->disconnect;