I think Skeeve is correct. Your best way forward is a hash of the ids.
my %set_contains = map { $_ => 1 } @id_set; if ( $set_contains{$some_id} ) { # $some_id is in the set } # removes $some_id from the set: delete $set_contains{$some_id};
In reply to Re^3: Testing if an array contains a value and then deleting it in most efficient way
by kyle
in thread Testing if an array contains a value and then deleting it in most efficient way
by karpatov
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |