in reply to Re: Re: passing hex argument as string
in thread passing hex argument as string

That's what
sprintf("%x", $hexnum)
does. If $hexnum is 0xdeadbeef, the sprintf will return "deadbeef". (Use %X instead of %x if you want "DEADBEEF".)

(updated to correctly say sprintf instead of printf)