in reply to Re^3: Subtracting Lists
in thread Subtracting Lists

I would suggest that educated_foo's (++) is the most portable,readable one with no dependencies.

That isn't the OP's criteria ("I am trying to find the fastest (not necessarily most elegant) way"). I think both his and mine are similarly fast, however.

I specifically avoided undef @h{}; for being cryptic.

I did appreciate the combining the extraction of the result into the operation itself, but it's less modular (i.e. complicates things if you want to work with the resulting set).

Replies are listed 'Best First'.
Re^5: Subtracting Lists
by educated_foo (Vicar) on Jun 02, 2008 at 16:38 UTC
    I specifically avoided undef @h{}; for being cryptic.
    That's at least part of the reason I used it ;). It's a weird idiom, but useful when you want to use hashes as sets rather than maps, so I think more people should be introduced to it. Besides, it creates fewer scalars and executes fewer operations than other methods, and the OP did say "fastest". That said, I like your solution (to a slightly different problem) -- simple, terse, and no bizarro modules.