Yes. The parser is forgiving. If you give a hex string to anattribute of "octets" type, it parses the hex into binary data. If you
give a printable string to an "octets" attribute, it assumes you're
being lazy. The printable string is used as the value for the attribute.
No. The binary attributes are printed and parsed as hex strings:0xabcdef. That is the normal (and expected) method of operation.
$RAD_REPLY{'State'} = "0x".unpack("H*",$data);
my $data = pack("H*",substr($RAD_REPLY{'State'},2)); # remove leading '0x' before pack