TEMP_HASH_BLOCK: { my %temphash; @temphash{@array1} = (); delete @temphash{@array1}; my @newarray = keys %temphash; }