On Fri, Jul 13, 2001 at 01:19:45PM +0100, Robin Houston wrote:
> @ary2{@ary2} = ();
> @ary1 = grep !exists $ary2{$_}, @ary1;
> print "@ary1\n";
Or even:
@ary1{@ary1} = ();
delete @ary1{@ary2};
@ary1 = keys %ary1;
I think the moral of the story is that set operations can be done more
efficiently on hashes than arrays.
.robin.
--
"It really depends on the architraves." --Harl
- set subtraction J�rg Ziefle
- Re: set subtraction Jeff 'japhy' Pinyan
- Re: set subtraction Robin Houston
- Re: set subtraction Robin Houston
- Re: set subtraction Adam Rice
- Re: set subtraction lembark
- Re: set subtraction Daniel S. Wilkerson
- Re: set subtraction Robin Houston
- Re: set subtraction Adam Rice
- Re: set subtraction Craig S. Cottingham
- Re: set subtraction Steven Lembark
- Re: set subtraction Craig S. Cottingham
