Well, lets not be too theoretical.  For short lists,
Jorg's way is probably faster.  Hash accesses look
nice and neat, but lots is going on for each one.

Daniel

--- Robin Houston <[EMAIL PROTECTED]> wrote:
> 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


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to