in reply to Re^2: Testing if an array contains a value and then deleting it in most efficient way
in thread Testing if an array contains a value and then deleting it in most efficient way

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};
  • Comment on Re^3: Testing if an array contains a value and then deleting it in most efficient way
  • Download Code