in reply to Merge arrays - seeking slicker approach
There's a temporary hash, but its scope is limited.my @mergedkeys = do {my %t; grep !$t{$_}++, @array1, @array2};
I think I first saw it used by John Orwant (perhaps in Mastering Algorithms with Perl), and later in the Perl Cookbook. I think it's also in the perlfaq. I must have used it a thousand programs.
|
|---|