use SQL::Abstract; my $sql = SQL::Abstract->new; my %data = ( name => 'test_name', phone => 'test_phone', city => 'test_city', country => 'test_country' ); my ( $statement, @bind ) = $sql->update("phone", \%data); printf("SQL --> %s\n %s\n\n", $statement, join(",", @bind) ); delete @data{qw( phone city )}; ( $statement, @bind ) = $sql->update("phone", \%data); printf("SQL --> %s\n %s\n\n", $statement, join(",", @bind) ); __END__ SQL --> UPDATE phone SET city = ?, country = ?, name = ?, phone = ? test_city,test_country,test_name,test_phone SQL --> UPDATE phone SET country = ?, name = ? test_country,test_name