in reply to How to get hexadecimal output in specific format?
It is all in the docs
$ perldoc -f sprintf : %X like %x, but using upper-case letters : 0 use zeros, not spaces, to right-justify [download]