title: Removing double quotes in beginning & end of string in a pipe delimited line in perl
body: <p>I have a Line that is pipe delimited:</p>
  
  <pre><code>John |DEMME|"9 Snowy "" Court"|WERRIBEE|""VIC""
  </code></pre>
  
  <p>I split my line to each fields</p>
  
  <pre><code>@fields = split (/\|/, $_);
  </code></pre>
  
  <p>what I want is to remove the double quotes in the beginning/end of each fields
  but it should retain the double quotes that are in between.</p>
  
  <p>expected output</p>
  
  <pre><code>John |DEMME|9 Snowy "" Court|WERRIBEE|VIC
  </code></pre>
  
  <p>I also tried this</p>
  
  <pre><code>s/^\"|"$//g;
  </code></pre>
  
  <p>but what it does is it reads by line not but fields, so it will only remove the double qoutes which are at the beginnig and end of the line.</p>
  
  <p>another scenario:</p>
  
  <pre><code>John |DEMME| "Shop 6A ""Atlantic on Coolum""|WERRIBEE|VIC
  </code></pre>
  
  <p>output should be</p>
  
  <pre><code>John |DEMME| Shop 6A "Pacific on Coolum"|WERRIBEE|VIC
  </code></pre>
  
  <p>I hope you guys can help me with this.</p>
  
  <p>thank you very much</p>