http://www.perlmonks.org?node_id=413152


in reply to Arrays and Hashes Mapping

If I understand you correctly, perhaps something like this:

@list = ('one' , 'two' , 'three'); %hash = ( one => 1 , two => 2 , three => 3 ); @list = grep { !$hash{$_} } @list;

Replies are listed 'Best First'.
Re^2: Arrays and Hashes Mapping
by kappa (Chaplain) on Dec 08, 2004 at 12:17 UTC
    Better use exists here, so that ( zero => 0, empty => '' ) won't give you false positives:
    @list = grep { !exists $hash{$_} } @list;
    --kap