my %seen; for (@input) { $seen{$_}++ && warn "$_ already entered\n"; }