dinesh wrote:
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 think it must be a string, or else Perl will convert it to decimal whether you like it or not...

    my $num = 0x82;
    print "$num\n";  # prints 130

So if the function expects a hex value, you'd better pass it as a string.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

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


Reply via email to