my @a = ("bob", "bob", "martha", "bob"); my %a; @a{@a} = (); print keys %a;