in reply to hex numbers

I am simply trying to get the hex value into a variable.

If by that you mean converting something like the string "FE" into the number 254, then what you are looking for is hex.

Update: And if that's not what you're looking for, please show an SSCCE, in particular please show the contents of the variable you're trying to convert using Data::Dump or Data::Dumper with $Data::Dumper::Useqq=1;.