#!/usr/bin/perl -w use strict; my @array = qw(dog cat cow horse donkey chicken); my %items = (cat => 1, donkey =>1); @array = grep {not exists $items{$_}} @array; print "@array\n"; __END__ prints: dog cow horse chicken
--
John.
In reply to Re: Reducing array
by jmcnamara
in thread Reducing array
by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |