How can I convert a number, $d = 1024, in decimal to 0xFF in hex in Perl?
The d variable needs to be assigned to a different variable and be printed, so for readability I required it to be in hexadecimal format.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1024in decimal is not0xFFin hex. Instead, it is0x400.You can use sprintf as: