You want hex($clid).
sprintf "%d" doesn't convert something that isn't a number into a number. In fact, it does the opposite. It converts numbers into their string representation.
Your test snippet is not equivalent because 0x0000000b doesn't produce the string 0x0000000b which you have in your actual code.
$ perl -wE'say sprintf "%d", "0x0000000b"' Argument "0x0000000b" isn't numeric in sprintf at -e line 1. 0
Why didn't you mention you were getting an error message?
In reply to Re: sprintf to hash
by ikegami
in thread sprintf to hash
by teamassociated
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |