Removing entries in array based on another array

From: Leif Wessman (leifwessman_at_hotmail.com)
Date: 08/29/04

  • Next message: Steve O'Hara-Smith: "Re: Larry Wall & Cults"
    Date: 29 Aug 2004 00:27:48 -0700
    
    

    I would like to remove the complete entry in an array if the value of
    the entry matches any of the values in another array.

    Like this:

    use strict;
    use warnings;

    my @names ("bob","barney","-","lisa","UNKNOWN");
    my @delete ("-","unknown");

    ...

    result should be that @names contains only bob, barney and lisa.
    Thanks for any input!

    Leif


  • Next message: Steve O'Hara-Smith: "Re: Larry Wall & Cults"