
BillKSmith
Veteran
Jul 4, 2011, 8:47 PM
Views: 626
|
|
Re: [soeeom] help with obtimizing
|
|
|
I am not sure what you mean by 'weed out replicas'. When a word is replicated in the original, do you want to remove all copies of it or all but one. Assuming the later, use the uniq function in the module List::MoreUtils. untested. use List::MoreUtils qw (uniq); @text = uniq grep {/^@/} @words; This solution assumes one word perl element of @words. Your code suggests that this is not true. Use your code. Filter your results with uniq on a separate line. Good Luck, Bill
(This post was edited by BillKSmith on Jul 5, 2011, 4:56 AM)
|