in reply to Hex/binary/Decimal
sub hexstring2num { my $n = hex($_[0]); return ($n >> 5) & 0x1f; } [download]