title: modifying attribute in $self using regex
body: <p>I am new to perl and i am having issues in modifying an attribute under saved in <code>$self</code>.</p>
  
  <p>I have an attribute called "devices" inside <code>$self</code>, if I print it in perl debugger it prints like this :</p>
  
  <pre><code>DB&lt;22&gt; x $self-&gt;{devices}
  0  ARRAY(0xa1ec308)
  0  "BG-SOKU-SAA01\cM\cJBG-SOKU-TS01 BG-SOKU-DCN01"
  </code></pre>
  
  <p>Now I want to replace <code>\cM\cJ</code> and whitespace with commas in the above attribute. So I am writing a regex for it which is like this :</p>
  
  <pre><code>my @dM= @{$self-&gt;{devices}};
  $dM[0]=~ s/\cM\cJ/,/g;
  $dM[0]=~ s/ /,/g;
  </code></pre>
  
  <p>Now when I print the <code>$self-&gt;{devices}</code> it gives me this :</p>
  
  <pre><code>DB&lt;22&gt; x $self-&gt;{devices}
  0  ARRAY(0xa1ec308)
  0  'BG-SOKU-SAA01,BG-SOKU-TS01,BG-SOKU-DCN01'
  </code></pre>
  
  <p>RegEx works but when I pass it to some other class and try to iterate over it, it takes comma separated device names as one single value rather than taking 1 device name each.</p>
  
  <p>I dont know what is going wrong.</p>
  
  <p>Please help me out with this.</p>