title: Perl - Convert integer to text Char(1,2,3,4,5,6)
body: <p>I am after some help trying to convert the following log I have to plain text.</p>
  <p>This is a URL so there maybe %20 = 'space' and other but the main bit I am trying convert is the <code>char(1,2,3,4,5,6)</code> to text.</p>
  <p>Below is an example of what I am trying to convert.</p>
  <blockquote>
  <p>select%20char(45,120,49,45,81,45),char(45,120,50,45,81,45),char(45,120,51,45,81,45)</p>
  </blockquote>
  <p>What I have tried so far is the following while trying to added into the <code>char(in here)</code> to convert with the <code>chr($2)</code></p>
  <pre><code>perl -pe &quot;s/(char())/chr($2)/ge&quot; 
  </code></pre>
  <p>All this has manage to do is remove the char but now I am trying to convert the number to text and remove the commas and brackets.</p>
  <p>I maybe way off with how I am doing as I am fairly new to to perl.</p>
  <blockquote>
  <p>perl -pe &quot;s/<strong>word to remove</strong>/<strong>word to change it to</strong>/ge&quot;</p>
  <p>&quot;s/(char(<strong>what goes in here</strong>))/chr($2)/ge&quot;</p>
  </blockquote>
  <p>Output try to achieve is</p>
  <blockquote>
  <p>select -x1-Q-,-x2-Q-,-x3-Q-</p>
  <p>Or</p>
  <p>select%20-x1-Q-,-x2-Q-,-x3-Q-</p>
  </blockquote>
  <p>Thanks for any help</p>