in reply to mistake in style guide?

They won't be the same (which you could check by running it with sample arrays). Take another look at the foreach block ... there's a logical AND in there, meaning the second operation will only be performed if the first was true -- and the first is true only when a previously seen key waltzes through the loop. Thus %union will contain every element in both arrays, but %isect will only contain elements common to both arrays (the arrays are assumed to be unique).

Replies are listed 'Best First'.
Re: Re: mistake in style guide?
by thpfft (Chaplain) on May 24, 2001 at 18:15 UTC

    thank you. i completely forgot about ++x and x++. stupid boy. useful lesson.