http://www.perlmonks.org?node_id=1037130


in reply to How to get hexadecimal output in specific format?

my $hex = sprintf "%08X", $dec;

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

Enjoy, Have FUN! H.Merijn