in reply to Illegal hexadecimal digit error

The sprintf that assigns to $hex_num contains a newline. Newlines aren't hex numbers, just as the warning says.

Abigail