foreach (@ARRAY) { push @WHERE, { X => $_ }, "OR"; } pop @WHERE; $DB->update( { table => 'table', fields => { Y => 0 }, where => \@where } );