title: Using hexadecimal values in a Perl variable
body: <p>I have a variable, <code>$count</code>, which will take a decimal value from the command line, and I have a piece of code which generates files with name <code>filename001 filename002 ....filename00a,filename00b</code> etc. It appends a hexadecimal number(without 0x) to <code>filename</code> for every new file it generates.</p>
  
  <p>I use the variable <code>$count</code> to keep track of the number that is appended to <code>filename</code>. I want to pull out lines containing a particular text <code>Result:</code> from the generated file (<code>filename00b filename00a</code>, etc.). For this purpose I use the grep tool in the following way:</p>
  
  <pre><code>`grep "Result:" path to the file/filename0*$count`
  </code></pre>
  
  <p>This works fine till I reach the 10th file when 10 becomes <code>a</code> in hexadecimal, but <code>$count</code> in the grep command is simplified to 10, so grep is not able to find the file. I tried using <code>hex($count)</code>, but it does not seem to work. It required that <code>$count</code> variable can be incremented or decremented, and it still holds the hex value. Is there a way to do this?</p>