hex
Interprets a hexadecimal string as an integer.
Accepts an optional 0x or 0X prefix. Underscores are allowed as
digit separators. Leading and trailing whitespace is stripped.
Returns 0 for empty or non-hex input.
Synopsis
$val = hex("ff"); # 255
$val = hex("0xDEAD"); # 57005
$val = hex("ff_ff"); # 65535