in reply to Find unmatched between an array and a hash

You can use nested greps.

my @result = grep { my $lang = $_; ! grep { $lang eq $_ } @employee } +keys %languages;

alternatively you can use Quantum::Superpositions

Replies are listed 'Best First'.
Re: Re: Find unmatched between an array and a hash
by merlyn (Sage) on Feb 07, 2001 at 06:16 UTC
(tye)Re: Find unmatched between an array and a hash
by tye (Sage) on Feb 07, 2001 at 10:10 UTC

    This isn't slick, but it is straight-forward and seems like it should be fairly fast:

    my @result= do { my %temp; @temp{@employee}= (); grep ! exists $temp{$_}, keys %languages; }

    Then again, with Perl and an N of 6, I don't think O(N*N) is much of a problem. ;)

            - tye (but my friends call me "Tye")