title: Perl one-liner with single quote
body: <p>I use a Perl one-liner to create an SQL statement, but I am not able to include single quotes.</p>
  <p>This is what I want: Take the first field and add quotes to it.</p>
  <pre class="lang-none prettyprint-override"><code>echo &quot;a,b&quot; | perl -F',' -lane 'print $F[0];'
   'a'
  </code></pre>
  <p>I tried a few different ways, but it didn't work for me.</p>
  <ol>
  <li><p> </p>
  <pre class="lang-none prettyprint-override"><code>echo &quot;a,b&quot; | perl -F',' -lane 'print qq('$F[0]');'
  [0]
  </code></pre>
  </li>
  <li><p> </p>
  <pre class="lang-none prettyprint-override"><code>echo &quot;a,b&quot; | perl -F',' -lane 'print q('$F[0]');'
  [0]
  </code></pre>
  </li>
  </ol>
  <p>Here is another interesting issue.</p>
  <p>It is printing a single quote with the print statement, but if I assign a value to the variable and print, it's not working.</p>
  <pre class="lang-none prettyprint-override"><code>perl -lwe &quot;print q( i'am );&quot;
   i'am
  
  perl -lwe &quot;$b=q( didn't ); print $b&quot;
  </code></pre>
  <p>How can we use single and double quotes in Perl one-liners?</p>