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


in reply to I need Hex conversion, not!

Your point is...?

If you want to print as hex you need to use the format string as you show in your second example...

printf("0x%02X",$SM);

If you don't want to do that "everywhere" you can always create a sub such that:

| hand waving here... my $n = 0x85; printf "and the majic number is: %s\n",as_hex($n); | more handwaving exit(0); sub as_hex{ my $x=shift; sprintf "%X",$x; }


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg