Hello,

I have a requirement for passing a hex value like this to a function.

Example code:
my $ipmbAddress = getIpmbAddress(...); ## returns 82

getDeviceID($ip, $ipmbAddress);

Here in the above code, the getDeviceID() fucntion will accept only
0x82 (hex number). How to convert the number 82 to 0x82 (Note that
this should not be as string)

I tried the following but not working properly.
$ipmbAddress = "0x".$ipmbAddress;
$ipmbAddress = hex("$ipmbAddress");
$ipmbAddress = sprintf(0x%0x, $ipmbAddress);
getDeviceID($ip, $ipmbAddress);


Please help.

Thanks,
DineshK
===========


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to