title: Erlang add element to same list
body: <p>Erlang add element to same list? is it possible in erlang? If not then Please help me someone to achieve this with any alternate solution. </p>
  
  <p>Actual requirement which I have to do is as follows:</p>
  
  <p>I have multiple list ids so based on list ids, I have to fetch all subscribers email id whose status is not equal to 'B', 'U' (Bounced and Unsubscribed) into 1 list and after that I have to remove duplicate email ids from that listSubscribers, once I got the proper ListSubscriber then I'll loop it and send email to all unique subscribers. Issue comes here when loop it to list to fetch all subscribers first time when I get subscribers
  and when loop goes to second one and gets the subscribers and it will add to the same list throwing error bcoz list is already bound.</p>
  
  <p>Sample Code what I am doing...</p>
  
  <pre><code>% I have multiple list it can be any number, So by loop through each list id fetching subscribers.
  
  lists:foreach( fun (ListId) -&gt; 
  
  ListSubscribers = emailmarketing:get_list_subscribers(ListId), %% Here I am fetching All email subscriber Ids...
  
  io:fwrite("Total Subscriber from this list -&gt; ~p ~n", [ListSubscribers])
  
  end, ListIds),
  
  UniqueSubscriberList = lists:usort(ListSubscribers),
  
  %% Now I'll loop here and send each subscriber campaign email.
  </code></pre>
  
  <p>Thanks!</p>