title: How to convert a hex-encoded string to a byte string in Perl?
body: <p>My original code is in <a href="http://en.wikipedia.org/wiki/Python_%28programming_language%29" rel="nofollow">Python</a>, but I need to convert it to Perl for some libraries that I don't have at my disposal in Python.</p>
  
  <p>In Python I would do this:</p>
  
  <pre><code>packet=binascii.unhexlify('F0000000F6905C452001A8C0000000000160994E810FB54E0100DB0000000000000')
  </code></pre>
  
  <p>AND</p>
  
  <p>This would create a string containing the binary representation of:</p>
  
  <pre><code>0xF0 0x00 0x00 0x00 0xF6 0x90 0x5C 0x45 etc...
  </code></pre>
  
  <p>Now that my string is a byte array I can send it as the payload for my packet. How do I do it Perl?</p>