In Perl, pack and unpack have two templates for converting bytes to/from hex:
h A hex string (low nybble first).
h
I imagine this being useful when transfering data to or reading data from a machine with different endianess. If some process expects to receive data the way it would normally represent it in memory, then you better send your data just that way.