in reply to Keeping order, no duplicate and the complete keyset
This doesn't remove dupes though (see ikegami's comments above), and I'm not sure if it can be simply modified to do so.use strict; use warnings; my @big = qw(a b c d e f g h i); my @small = qw(f c d g); my %small; $small{$_}=1 for @small; my @keys_wanted = @small; foreach ( @big ) { push @keys_wanted, $_ unless $small{$_}; } print "@keys_wanted";
|
|---|