my %set; @set{qw(I agree)} = (); print sort keys %set; # Iagree #### @set{@list} = (undef) x scalar @list;