title: How do I convert a decimal number to a hex string in Perl?
body: <p>How do I convert a decimal number to a hex string in Perl?</p>
  
  <p>For example, I would like to convert <code>2001</code> into "0x07" and "0xD1".</p>