MrCBofBCinTX
Technical User
I am searching for different items of interest to then get full details later.
I want to look at details for each individual item, but my search produces two useful fields, both of which have duplicates, but (usually) a combination of the two fields produces a unique item.
field1 = 97865 field2 = DF-54H
field1 = 97865 field2 = DF-53K
field1 = 97865 field2 = DF-54HFG
field1 = 97865 field2 = DF-57H
field1 = 97855 field2 = DF-54H
field1 = 90003 field2 = DF-54H
field1 = 23407 field2 = DF-54H
field1 = 97456 field2 = DF-54H
I know how to remove duplicates from an array, but how can I do this other than joining the two fields with a separator character?
then splitting.
Is there a better method or is this good enough?
I want to look at details for each individual item, but my search produces two useful fields, both of which have duplicates, but (usually) a combination of the two fields produces a unique item.
field1 = 97865 field2 = DF-54H
field1 = 97865 field2 = DF-53K
field1 = 97865 field2 = DF-54HFG
field1 = 97865 field2 = DF-57H
field1 = 97855 field2 = DF-54H
field1 = 90003 field2 = DF-54H
field1 = 23407 field2 = DF-54H
field1 = 97456 field2 = DF-54H
I know how to remove duplicates from an array, but how can I do this other than joining the two fields with a separator character?
Code:
push @list,join(":",$field1,$field2);
@list = grep ++$temp{$_} < 2, @list;
Is there a better method or is this good enough?