note
blue_cowdawg
<ul><ul><i>
I need to use hex numbers for something but when I assign hex number to something
</i></ul></ul>
<p>
Your point is...?
</p>
<p>
If you want to print as hex you need to use the format string as you show in your second example...
<code>
printf("0x%02X",$SM);
</code>
</p>
<p>
If you don't want to do that "everywhere" you can always create a sub such that:
<code>
| 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;
}
</code>
</p>
<div class="pmsig"><div class="pmsig-72516">
<hr>
<font size="-2">
Peter L. Berghold -- Unix Professional<br>
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg<br>
</font>
</div></div>
1012021
1012021